Ticket #5 (new enhancement)
GHC extension for higher rank types in constraints
|Reported by:||jmcarthur||Owned by:||somebody|
I've been putting a little thought into how to combine an algebra with functors in the same way that Alternative lifts monoids into Applicatives and MonadPlus? lifts monoids into Monads (with some extra laws). It occurred to me that the relationship between, say, Monoid, Applicative, and Alternative could be expressed like this:
constraint Alternative f = (Applicative f, forall a . Monoid (f a))
The above syntax is a combination of the proposed constraint families extension and this proposal. The "forall" portion is the one I'd like to focus on. I haven't put much thought into it yet, but perhaps this could open opportunities for generalization elsewhere.