Control-monad-failure is a project mainly written in Haskell, it's free.
A class of monads which can fail with an error
DESCRIPTION:
This package provides a class for monads which can fail with an error
class Monad m => MonadFailure e m where failure :: e -> m a
There is further information in the Haskell wiki:
http://www.haskell.org/haskellwiki/Failure
INSTALL:
There are two versions of this library, one packaging instances for the monads defined in the transformers library, and another one with instances for the monad transformer library (mtl).
You can install each of them with Cabal by first removing the .pp suffix from its associated cabal descriptor and then running the command "cabal install". The cabal descriptor files are:
transformers - control-monad-failure.cabal.pp mtl - control-monad-failure-mtl.cabal.pp
CONTRIBUTING:
The sources are available in a git repository at:
http://github.com/pepeiborra/control-monad-failure
Patches are welcome.