PROPOSAL: Make Applicative a superclass of Monad
Ross Paterson
ross at soi.city.ac.uk
Tue Jun 24 16:22:07 EDT 2008
On Tue, Jun 24, 2008 at 11:14:41AM +0100, Malcolm Wallace wrote:
> 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 think you're abusing the class, and it's bound to go wrong sooner
or later. A monad is morally an applicative functor, and clients ought
to be able to assume, as the docs say, that pure = return and (<*>) = ap.
The lazy and strict things should be different types.
More information about the Libraries
mailing list