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

Herbert Valerio Riedel hvr at gnu.org
Wed Jun 12 12:28:11 CEST 2013


On 2013-06-12 at 00:04:04 +0200, Gabriel Gonzalez wrote:
> I think types that lack an empty element are a misfeature.  

...so having a data-type for representing non-empty lists (on which
operation such as head/last/minimum/maximum et. al can be proper
statically guaranteed total functions as opposed to resorting to
'Maybe'-wrapped results which need to be checked dynamically at runtime)
is a misfeature?

> They usually end up contaminating everything they touch, which is why
> semigroups forms an entire parallel ecosystem of its own.

Can you provide a concrete example showing the kind of problematic
"contamination" that is caused by semigroup-forming types?

cheers,
  hvr



More information about the Libraries mailing list