PROPOSAL: Make Applicative a superclass of Monad

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Tue Jun 24 06:14:41 EDT 2008


Ashley Yakeley <ashley at semantic.org> wrote:

> Make Applicative (in Control.Applicative) a superclass of Monad (in 
> Control.Monad).

I'm strongly against.

Some datatypes have several different possible implementations of
Applicative, for instance, they may be either lazy or strict.  The
PolyParse library relies crucially on the fact that the Monad and
Applicative instances for the Parser type have different strictness
behaviours.

I worry that if Applicative were to become a superclass of Monad, this
way of partitioning my API into lazy and strict portions may no longer
be possible, or least, a good deal less convenient.

Regards,
    Malcolm

Footnote.  PolyParse does not currently use the real Applicative class,
           but it probably ought to.


More information about the Libraries mailing list