Haskell Language Monoid An instance of Monoid for ()


Example

() is a Monoid. Since there is only one value of type (), there's only one thing mempty and mappend could do:

instance Monoid () where
    mempty = ()
    () `mappend` () = ()