mirror of
https://github.com/sdiehl/write-you-a-haskell.git
synced 2024-08-16 15:11:06 +03:00
Changes to the Monoids section of the Basics chapter
This commit is contained in:
parent
363eb58099
commit
8073d55aaf
@ -508,8 +508,8 @@ Monoids
|
||||
-------
|
||||
|
||||
Monoids provide an interface for structures which have an associative operation
|
||||
(``mappend``) and a neutral element (``mempty``) which is the zero for the join
|
||||
operation.
|
||||
(``mappend``, there is also the synonym ``<>``) and a neutral
|
||||
(also: unit or zero) element (``mempty``) for that operation.
|
||||
|
||||
```haskell
|
||||
class Monoid a where
|
||||
@ -518,7 +518,8 @@ class Monoid a where
|
||||
mconcat :: [a] -> a
|
||||
```
|
||||
|
||||
The canonical example is the list type with the zero being the empty list.
|
||||
The canonical example is the list type with concatenation as the operation
|
||||
and the empty list as zero.
|
||||
|
||||
```haskell
|
||||
import Data.Monoid
|
||||
|
Loading…
Reference in New Issue
Block a user