We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c48a6e6 commit e7de566Copy full SHA for e7de566
src/Data/Semigroup.purs
@@ -20,6 +20,12 @@ import Type.Data.RowList (RLProxy(..))
20
-- | One example of a `Semigroup` is `String`, with `(<>)` defined as string
21
-- | concatenation. Another example is `List a`, with `(<>)` defined as
22
-- | list concatenation.
23
+-- |
24
+-- | There are two other ways to implement an instance for this type class
25
+-- | regardless of which type is used. These instances can be used by
26
+-- | wrapping the values in one of the two newtypes below:
27
+-- | 1. `First` - Use the first argument every time: `append first _ = first`.
28
+-- | 2. `Last` - Use the last argument every time: `append _ last = last`.
29
class Semigroup a where
30
append :: a -> a -> a
31
0 commit comments