ether-0.4.0.1: Monad transformers and classes

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Trans.Ether.Except

Contents

Description

Synopsis

The Except monad

type Except tag e = ExceptT tag e Identity Source

The parameterizable exception monad.

Computations are either exceptions or normal values.

The return function returns a normal value, while >>= exits on the first exception.

except :: Monad m => proxy tag -> Either e a -> ExceptT tag e m a Source

Constructor for computations in the exception monad (the inverse of runExcept).

runExcept :: proxy tag -> Except tag e a -> Either e a Source

Runs an Except and returns either an exception or a normal value.

The ExceptT monad transformer

type ExceptT tag e = TaggedTrans tag (ExceptT e) Source

The exception monad transformer.

The return function returns a normal value, while >>= exits on the first exception.

exceptT :: proxy tag -> m (Either e a) -> ExceptT tag e m a Source

Constructor for computations in the exception monad transformer.

runExceptT :: proxy tag -> ExceptT tag e m a -> m (Either e a) Source

Runs an ExceptT and returns either an exception or a normal value.

Exception operations

throw :: Monad m => proxy tag -> e -> ExceptT tag e m a Source

Is used within a monadic computation to begin exception processing.

catch :: Monad m => proxy tag -> ExceptT tag e m a -> (e -> ExceptT tag e m a) -> ExceptT tag e m a Source

A handler function to handle previous exceptions and return to normal execution.