PROPOSAL: Make Applicative a superclass of Monad

Isaac Dupree isaacdupree at charter.net
Tue Jun 24 10:01:45 EDT 2008


Ashley Yakeley wrote:
> class Applicative m => Monad m where
>   (>>=) :: m a -> (a -> m b) -> m b
>   fail :: String -> m a
>   fail s = error s

I'd personally like (join :: m (m a) -> m a) to also be in Monad, with 
default definitions between (>>=) and join, because some monads are more 
naturally defined by one than the other.  (just while we're (not) making 
breaking changes, and because the default for (>>=) would have to depend 
on fmap, I though I'd mention it :-)

-Isaac


More information about the Libraries mailing list