monad-exception-0.1: Exstensible monadic exceptions

Safe HaskellSafe-Infered

Control.Monad.Trans.Exception

Contents

Description

This module exports the ExceptionT monad transformer.

Synopsis

The ExceptionT transformer

data ExceptionT m a Source

The ExceptionT monad transformer. This is can be used to add MonadException functionality otherwise pure monad stacks. If your monad stack is built on top of IO however, it already has MonadException functionality and you should use that instead, unless you have a good reason not to. Pass-through instances for the mtl type classes are provided automatically by the mtl-evil-instances package.

runExceptionT :: Monad m => ExceptionT m a -> m (Either SomeException a)Source

Run the ExceptionT monad transformer. This returns Right if everything goes okay, and Left in the case of an error, with the exception wrapped up in a SomeException.