Proposal: Make Semigroup as a superclass of Monoid

Herbert Valerio Riedel hvr at gnu.org
Sun Mar 29 15:04:03 UTC 2015


On 2015-03-29 at 14:20:33 +0200, Jeremy wrote:
> 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.
>
> 2. GHC >7.12 will define Monoid as a subclass of Semigroup.

+1


More information about the Libraries mailing list