Skip to content

Add Semigroup & Monoid classes

Add Semigroup and Monoid classes

class Semigroup a where
    (<>) :: a -> a -> a -- Associative

class Semigroup a => Monoid a where
    mempty :: a -- left/right zero of (<>)

plus the respective instances for the standard types.

See also ghc:Proposal/SemigroupMonoid

Edited by Herbert Valerio Riedel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information