A subclass of Semigroup
class Monoid a
where
(<>) :: a -> a -> a
mempty :: a
class Monoid a
where
(<>) :: a -> a -> a
mempty :: a
mconcat :: [a] -> a
<>
defines composability (identical to Semigroup)mempty
: the identity elementmconcat
: apply <>
to a
multiple times.(a <> b) <> c == a <> (b <> c)
.a <> mempty = a
& mempty a = a