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.
On Sun, Mar 29, 2015 at 8:20 AM, Jeremy <voldermort@hotmail.com> wrote:The proposal to make Semigroup a superclass of Monoid was discussed a while
ago [1], and the conclusion was to "put this off until the dust has settled
from the AMP and FT changes".
Now that 7.10 is out, I would like to re-propose. The proposed plan is
similar to AMP, but less invasive, as (in my subjective experience)
user-defined Monoids are much less common than user-defined Monads.
1. GHC 7.12 will include Semigroup and NonEmpty in base. All Monoid
instances, and anything else which forms a Semigroup, will have a Semigroup
instance. GHC will issue a warning when it encounters an instance of Monoid
which is not an instance of Semigroup.Strongly opposed to adding a NonEmpty type to base. It's a step in the wrong direction:the problem it clumsily tries to address is solved much better by refinement types à laLiquidHaskell, which handles this and other whole classes of problems at once.Now, we don't have LiquidHaskell in GHC yet; but let's not settle for adding a NonEmptytype that we know is an inferior approach to base now, when it will likely be very hardto remove it in the future.I know there are some who use NonEmpty types currently, but I think their needs arejust as well (if not better) met by putting the type in a small package outside of basewith few dependencies.
2. GHC >7.12 will define Monoid as a subclass of Semigroup.While it frustrates me to repeatedly see so much time spent by both GHC developers
and Haskell library and application programmers on changes like this with fairly smallupside, I don't have any fundamental objection to ending up in a state with Semigroupas a superclass of Monoid.Regards,Reid Barton
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries