[Haskell-cafe] Stacking monads

Jonathan Cast jonathanccast at fastmail.fm
Fri Oct 3 15:52:03 EDT 2008


On Fri, 2008-10-03 at 20:43 +0100, Andrew Coppin wrote:
> David Menendez wrote:
> > It wasn't until fairly recently that people realized
> > that you could do useful things if you had "return" and "ap", but not
> > (>>=), which why we have some unfortunate limitations in the Haskell
> > prelude, like Applicative not being a superclass of Monad.
> >
> > This leads to all the duplication between Applicative and Monad. In a
> > perfect world, we would only need the Applicative versions.
> >   
> 
> OK. So it's broken "for compatibility" then? (Presumably any time you 
> change something from the Prelude, mass breakage ensues!)

I'm not a big fan of backward-compatibility myself, but changing Monad
to be a sub-class of Applicative actually would have broken every monad
instance in existence (at the time Applicative was added, since it
didn't have any instances yet).  I don't know what proportion of Haskell
programs/libraries/etc. have at least one Monad instance in them, but I
would guess it's high.

jcc




More information about the Haskell-Cafe mailing list