<p dir="ltr">Wouldn't your concerns about NonEmpty be addressed by keeping its type abstract? Then something like Liquid Haskell could be used to define it better.</p>
<div class="gmail_quote">On May 4, 2015 10:19 AM, "Reid Barton" <<a href="mailto:rwbarton@gmail.com">rwbarton@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">On Sun, Mar 29, 2015 at 8:20 AM, Jeremy <span dir="ltr"><<a href="mailto:voldermort@hotmail.com" target="_blank">voldermort@hotmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);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></blockquote><div><br></div><div>Strongly opposed to adding a NonEmpty type to base. It's a step in the wrong direction:<br></div><div>the problem it clumsily tries to address is solved much better by refinement types à la<br></div><div>LiquidHaskell, which handles this and other whole classes of problems at once.<br><br></div><div>Now, we don't have LiquidHaskell in GHC yet; but let's not settle for adding a NonEmpty<br></div><div>type that we know is an inferior approach to base now, when it will likely be very hard<br></div><div>to remove it in the future.<br><br></div><div>I know there are some who use NonEmpty types currently, but I think their needs are<br></div><div>just as well (if not better) met by putting the type in a small package outside of base<br></div><div>with few dependencies.<br> </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
2. GHC >7.12 will define Monoid as a subclass of Semigroup.<br></blockquote><div><br></div><div>While it frustrates me to repeatedly see so much time spent by both GHC developers<br>and Haskell library and application programmers on changes like this with fairly small<br></div><div>upside, I don't have any fundamental objection to ending up in a state with Semigroup<br></div><div>as a superclass of Monoid.<br></div><div> </div>Regards,<br></div><div class="gmail_quote">Reid Barton<br></div></div></div>
<br>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
<br></blockquote></div>