Skip to content

Commit bf1a5b4

Browse files
Add level 3 header for overview of Monoid/Semigroup newtypes
1 parent 6587f19 commit bf1a5b4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Data/Monoid.purs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import Type.Data.RowList (RLProxy(..))
2929
-- | `<>` is used to combine individual results, and `mempty` gives the result
3030
-- | of folding an empty collection of elements.
3131
-- |
32+
-- | ### Newtypes for Monoid
33+
-- |
3234
-- | Some types (e.g. `Int`, `Boolean`) can implement multiple law-abiding
3335
-- | instances for `Monoid`. For example, `<>` could be `+` and `mempty` could
3436
-- | be `0`. Likewise, `<>` could be `*` and `mempty` could be `1`.

src/Data/Semigroup.purs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import Type.Data.RowList (RLProxy(..))
2121
-- | concatenation. Another example is `List a`, with `(<>)` defined as
2222
-- | list concatenation.
2323
-- |
24+
-- | ### Newtypes for Semigroup
25+
-- |
2426
-- | There are two other ways to implement an instance for this type class
2527
-- | regardless of which type is used. These instances can be used by
2628
-- | wrapping the values in one of the two newtypes below:

0 commit comments

Comments
 (0)