Proposal: Add Data.Semigroup to base, as a superclass of Monoid

Andreas Abel andreas.abel at ifi.lmu.de
Wed Jun 12 22:13:41 CEST 2013


On 12.06.13 11:03 AM, Nikita Volkov wrote:
>
> Concerning the discussion on Monoid's <>. Since we've stepped on a path
> of Prelude generalization, what about reimplementing the ++ in terms of
> Monoid? It's proven to be quite useful in the Snoyman's (of Yesod)
> classy-prelude
> <http://hackage.haskell.org/packages/archive/classy-prelude/0.5.8/doc/html/ClassyPrelude.html#v:-43--43-> experiment.
> Just think about it: we don't lose anything, and we get the expected
> String-like API for working with Text, ByteString and etc, and we also
> free up the <> operator.

Makes sense.

+1 for ++ instead of <>.   Both are right-associative, so there are no 
problems with that.

-- 
Andreas Abel  <><      Du bist der geliebte Mensch.

Theoretical Computer Science, University of Munich
Oettingenstr. 67, D-80538 Munich, GERMANY

andreas.abel at ifi.lmu.de
http://www2.tcs.ifi.lmu.de/~abel/



More information about the Libraries mailing list