[Haskell-cafe] [Haskell] Functor => Applicative => Monad

Jonathan Geddes geddes.jonathan at gmail.com
Wed Dec 15 03:01:21 CET 2010

Fail can't just be removed. That would just break too much code. For
example, I find myself writing code like the following:

>[a,b,c] <- Just someList

in place of

>let [a,b,c] = someList

so that pattern match failure is "lifted" into the maybe monad (as
long as I'm already in the maybe monad).

I would like to see a MonadFail class, with one method 'fail', such
that it is a compile-time error to try 'failable' pattern matches in a
monad that is not an instance of MonadFail.


More information about the Haskell-Cafe mailing list