Skip to content

Commit 203d7dd

Browse files
authored
Merge pull request #171 from sourcecodemorsecode/patch-4
English is a terrible language ("aggregatable" isn't a word)
2 parents b279ee6 + be83eac commit 203d7dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_chapters/haskell4.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Note that since the `(+)` operator is associative—a+(b+c) = (a+b)+c—`foldr`
104104

105105
## Monoid
106106

107-
In the example fold above, we provide the `(+)` function to tell `foldl` how to aggregate elements of the list. There is also a typeclass for things that are “automatically aggregatable” or “concatenatable” called `Monoid` which declares a general function for `mappend` combining two `Monoid`s into one, a `mempty` value such that any Monoid `mappend`'ed with `mempty` is itself, and a concatenation function for lists of `Monoid` called `mconcat`.
107+
In the example fold above, we provide the `(+)` function to tell `foldl` how to aggregate elements of the list. There is also a typeclass for things that are “automatically aggregable” or “concatenatable” called `Monoid` which declares a general function for `mappend` combining two `Monoid`s into one, a `mempty` value such that any Monoid `mappend`'ed with `mempty` is itself, and a concatenation function for lists of `Monoid` called `mconcat`.
108108

109109
```haskell
110110
Prelude> :i Monoid
@@ -133,7 +133,7 @@ Prelude Data.Monoid> getSum $ mconcat $ Sum <$> [5,8,3,1,7,6,2]
133133

134134
> 32
135135
136-
We make a data type aggregatable by instancing `Monoid` and providing definitions for the functions `mappend` and `mempty`. For `Sum` these will be `(+)` and `0` respectively.
136+
We make a data type aggregable by instancing `Monoid` and providing definitions for the functions `mappend` and `mempty`. For `Sum` these will be `(+)` and `0` respectively.
137137
Lists are also themselves Monoidal, with `mappend` defined as an alias for list concatenation `(++)`, and mempty as `[]`. Thus, we can:
138138

139139
```haskell

0 commit comments

Comments
 (0)