Proposal: Make Semigroup as a superclass of Monoid

David Feuer david.feuer at gmail.com
Wed Apr 29 13:57:43 UTC 2015


Kmett's NonEmpty type (or similar) is the solution to this, but really, why
do you need an mconcat-like operation?

On Wed, Apr 29, 2015 at 9:51 AM, Stephen Tetley <stephen.tetley at gmail.com>
wrote:

> Empty lists are problematic if you want a mconcat like operation.
>
> Edward Kmett's semigroups package introduces an EmptyList type to
> avoid this (the downside being it introduces an EmptyList type).
>
> If you don't want an mconcat like operation then Semigroup only has
> one useful operation (<>).
>
>
>
> On 29 April 2015 at 14:13, David Feuer <david.feuer at gmail.com> wrote:
> > What's problematic about empty lists for semigroups?
> >
> > On Wed, Apr 29, 2015 at 8:51 AM, Stephen Tetley <
> stephen.tetley at gmail.com>
> > wrote:
> >>
> >> The consensus seems largely to favour the high level proposal to add a
> >> Semigroup class, but there hasn't been much discussion of the
> >> implementation details i.e. what to do about mappend or a
> >> Semigroup-like candidate (problematic for empty lists, of course).
> >>
> >>
> >>
> >> On 29 April 2015 at 12:24, Jeremy <voldermort at hotmail.com> wrote:
> >> > So what's the conclusion on this? We seem to have a strong consensus
> on
> >> > going
> >> > ahead with the proposal, and a weaker consensus for doing so via the
> >> > long
> >> > path.
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >> >
> http://haskell.1045720.n5.nabble.com/Proposal-Make-Semigroup-as-a-superclass-of-Monoid-tp5767835p5808129.html
> >> > Sent from the Haskell - Libraries mailing list archive at Nabble.com.
> >> > _______________________________________________
> >> > Libraries mailing list
> >> > Libraries at haskell.org
> >> > http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> >> _______________________________________________
> >> Libraries mailing list
> >> Libraries at haskell.org
> >> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150429/704fbaee/attachment.html>


More information about the Libraries mailing list