Folks,
We are extremely happy to announce the control-monad-failure and safe-failure packages for error handling.
control-monad-failure provides a basic notion of failure which does not commit to any concrete representation.
It is just a version of the MonadError class without the annoying bits.
> class MonadFailure e m where failure :: e -> m a
Instances are provided for several concrete representations of failure
handling: Maybe, Either, ErrorT, Control.Exception.Throw, and [].
safe-failure is a fork of Neil Mitchell's Safe package providing MonadFailure versions of several partial functions
in the Prelude, which instead of failing with a runtime error fail with Failure.
> head :: MonadFailure HeadFailure m => [a] -> m a
This is a joint release from the authors of the attempt and the control-monad-exception packages,
and accompanying releases of those packages have been made making them adopt the MonadFailure interface.
We have also created a wiki page explaining our reasons for following this path in:
http://www.haskellwiki.org/Failure
Thanks,
Jose Iborra, Nicolas Pouillard and Michael Snoyman