roam/20220312165629-monoid.org

615 B

Monoid

A Semigroup with an identity value.

In Haskell, the function representing the identity value for a given Monoid is mempty.

  mempty :: Monoid a => a
mempty in Haskell

Examples

List

Combined with append, identity value is the empty list ([])

Number Addition

Combined with +, identity value is 0

Number Multiplication

Combined with *, identity value is 1