std.monoid

Implementation of the Monoid type

Types

#[implicit]
type Monoid a = { semigroup : Semigroup a, empty : a }

Monoid a represents an semigroup an which has an identity. This means the following additional laws must hold:

  • forall x . append x empty == x
  • forall x . append empty x == x

Values

let empty ?m : forall a . [Monoid a] -> a

Note
  • Known as mempty in Haskell