<div dir="ltr">I'm tentatively +1 on this proposal, presuming we have a solid migration path for the semigroups package (which seems trivial if Edward's on board with this), and barring any solid objections in this discussion.<br></div><br><div class="gmail_quote">On Sun, Mar 29, 2015 at 3:21 PM Jeremy <<a href="mailto:voldermort@hotmail.com">voldermort@hotmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The proposal to make Semigroup a superclass of Monoid was discussed a while<br>
ago [1], and the conclusion was to "put this off until the dust has settled<br>
from the AMP and FT changes".<br>
<br>
Now that 7.10 is out, I would like to re-propose. The proposed plan is<br>
similar to AMP, but less invasive, as (in my subjective experience)<br>
user-defined Monoids are much less common than user-defined Monads.<br>
<br>
1. GHC 7.12 will include Semigroup and NonEmpty in base. All Monoid<br>
instances, and anything else which forms a Semigroup, will have a Semigroup<br>
instance. GHC will issue a warning when it encounters an instance of Monoid<br>
which is not an instance of Semigroup.<br>
<br>
2. GHC >7.12 will define Monoid as a subclass of Semigroup.<br>
<br>
Stage 2 could be delayed - or in the extreme case, cancelled - if the<br>
warnings following stage 1 indicate that the proposal would cause<br>
significant breakage of existing code, although this is not anticipated.<br>
<br>
The rationale for this change is:<br>
<br>
1. Semigroup is a popular package (this is relevant in combination with the<br>
following point).<br>
2. Using an existing Monoid as a Semigroup requires redefining it (or<br>
WrappedMonoid), leading to much boilerplate and duplication.<br>
3. NonEmpty is often redefined by beginners (or those who don't think it's<br>
worth having an extra dependency for).<br>
<br>
[1] <a href="https://mail.haskell.org/pipermail/libraries/2013-June/020188.html" target="_blank">https://mail.haskell.org/<u></u>pipermail/libraries/2013-June/<u></u>020188.html</a><br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://haskell.1045720.n5.nabble.com/Proposal-Make-Semigroup-as-a-superclass-of-Monoid-tp5767835.html" target="_blank">http://haskell.1045720.n5.<u></u>nabble.com/Proposal-Make-<u></u>Semigroup-as-a-superclass-of-<u></u>Monoid-tp5767835.html</a><br>
Sent from the Haskell - Libraries mailing list archive at Nabble.com.<br>
______________________________<u></u>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank">http://mail.haskell.org/cgi-<u></u>bin/mailman/listinfo/libraries</a><br>
</blockquote></div>