[Proposal] Add default implementation of mappend/mempty in terms of mconcat

Niklas Haas haskell at nand.wakku.to
Fri Jan 24 21:42:41 UTC 2014


Hello,

I noticed that the current Monoid class doesn't actually provide default
implementations of mappend/mempty in terms of mconcat, even though this
is technically very simple:

> mempty = mconcat []
> mappend a b = mconcat [a, b]

This would be a rather small and non-invasive change that shouldn't
break any existing programs. The main downside is that an empty Monoid
declaration would produce no warnings, but #7633 gives us the ability to
solve this.

Discussion period: 2 weeks


More information about the Libraries mailing list