
14 Dec
2010
14 Dec
'10
9:01 p.m.
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. --Jonathan