Proposal: Make Semigroup as a superclass of Monoid
Edward Kmett
ekmett at gmail.com
Tue May 12 22:33:43 UTC 2015
For folding containers of size >=1 with a semigroup I usually turn to
classes from the semigroupoids package:
http://hackage.haskell.org/package/semigroupoids-4.3/docs/Data-Semigroup-Foldable.html
http://hackage.haskell.org/package/semigroupoids-4.3/docs/Data-Semigroup-Traversable.html
They are placed there, rather than in something like semigroups, because
the 'return-less' variants of Monad and Applicative they need to provide
most operations are placed in that package.
-Edward
On Tue, May 12, 2015 at 3:05 PM, Henning Thielemann <
lemming at henning-thielemann.de> wrote:
>
> On Tue, 5 May 2015, Greg Weber wrote:
>
> The issue you have not raised that I am more concerned with is that
>> NonEmpty only works for lists.
>> Michael and I figured out how to extend the concept to any (Mono)Foldable
>> structure and also to be able to
>> demand lengths of > 1.
>>
>
> It's possible with the structure provided by "non-empty". It is also
> possible to construct types for lists of fixed length or lists with an
> arbitrary set of allowed lengths.
>
> _______________________________________________
> 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/20150512/5fbfc8c6/attachment.html>
More information about the Libraries
mailing list