control-monad-attempt-0.3.0.1: Monad transformer for attempt. (deprecated)

Control.Monad.Attempt

Description

Provide a monad transformer for the attempt monad, which allows the reporting of errors using extensible exceptions.

Synopsis

Documentation

newtype AttemptT m v

Constructors

AttemptT 

Fields

runAttemptT :: m (Attempt v)
 

Instances

MonadTrans AttemptT 
(Monad m, Exception e) => WrapFailure e (AttemptT m) 
(Exception e, Monad m) => Failure e (AttemptT m) 
Monad m => Monad (AttemptT m) 
Monad m => Functor (AttemptT m) 
Monad m => Applicative (AttemptT m) 
Monad m => FromAttempt (AttemptT m) 
MonadIO m => MonadIO (AttemptT m) 

evalAttemptT :: (Monad m, FromAttempt m) => AttemptT m v -> m v

Instances of FromAttempt specify a manner for embedding Attempt failures directly into the target data type. For example, the IO instance simply throws a runtime error. This is a convenience wrapper when you simply want to use that default action.

So given a type AttemptT IO Int, this function will convert it to IO Int, throwing any exceptions in the original value.

attemptT :: Monad m => (forall e. Exception e => e -> b) -> (a -> b) -> AttemptT m a -> m b

The equivalent of attempt for transformers. Given a success and failure handler, eliminates the AttemptT portion of the transformer stack.

attemptTIO :: (Exception eIn, Exception eOut) => (eIn -> eOut) -> IO v -> AttemptT IO v

Catches runtime (ie, IO) exceptions and represents them in an AttemptT transformer.

Like handle, the first argument to this function must explicitly state the type of its input.