std.monoid

Implementation of the Monoid type

Types

type Monoid a = { semigroup : std.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 . [std.monoid.Monoid a] -> a

Note
  • Known as mempty in Haskell