Proposal: Make Semigroup as a superclass of Monoid

David Feuer david.feuer at gmail.com
Wed Apr 29 14:48:57 UTC 2015


I'd definitely be -1 on an mconcat-like operation for Semigroup. I think
mconcat mostly fails to be useful for monoid, because all it has over fold
is knowledge of right and left bias and the theoretical (but practically, I
think, rather hard to exploit) ability to group and locally rearrange
elements while summing. Kmett has a version of Foldable designed to use
with semigroups, and I'd be okay with adding that.

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

> > why do you need an mconcat-like operation?
>
> Well, the more operations the better, especially derived ones rather
> than ones baked into the class.
>
> For me a class with only one operation wouldn't really meet the
> Fairburn threshold. In this case, I'd abstain from voting against as
> the consensus is high but I would like to see a proper proposal for
> what adding Semigroup includes (and what it leaves out) rather than a
> straw in the wind notion to just add it.
>
>
> On 29 April 2015 at 14:57, David Feuer <david.feuer at gmail.com> wrote:
> > 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/827e1760/attachment.html>


More information about the Libraries mailing list