Moduletransformers-0.6.1.1Haskell2010
Control.Monad.Trans.Except
This monad transformer extends a monad with the ability to throw exceptions.
A sequence of actions terminates normally, producing a value, only if none of the actions in the sequence throws an exception. If one throws an exception, the rest of the sequence is skipped and the composite action exits with that exception.
If the value of the exception is not required, the variant in Control.Monad.Trans.Maybe may be used instead.
- 2 types
- 15 values
- Packagetransformers-0.6.1.1
- Exports17
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceExcept.hs
The Except monad
5 declarationsConstructor for computations in the exception monad. (The inverse of runExcept).
Extractor for computations in the exception monad. (The inverse of except).
Transform any exceptions thrown by the computation using the given function (a specialization of withExceptT).
The ExceptT monad transformer
4 declarationsA monad transformer that adds exceptions to other monads.
ExceptT constructs a monad parameterized over two things:
e - The exception type.
m - The inner monad.
The return function yields a computation that produces the given
value, while >>= sequences two subcomputations, exiting on the
first exception.
Instances25Generic1, MonadTrans, Monad, Functor, MonadFix, MonadFail, …
Functor m => Generic1 (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptMonadTrans (ExceptT e)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptMonad m => Monad (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptFunctor m => Functor (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptMonadFix m => MonadFix (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptMonadFail m => MonadFail (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Functor m, Monad m) => Applicative (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptFoldable f => Foldable (ExceptT e f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptTraversable f => Traversable (ExceptT e f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Functor m, Monad m, Monoid e) => Alternative (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Monad m, Monoid e) => MonadPlus (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptMonadIO m => MonadIO (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptMonadZip m => MonadZip (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Eq e, Eq1 m) => Eq1 (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Ord e, Ord1 m) => Ord1 (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Read e, Read1 m) => Read1 (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Show e, Show1 m) => Show1 (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptContravariant m => Contravariant (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Eq e, Eq1 m, Eq a) => Eq (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Ord e, Ord1 m, Ord a) => Ord (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Read e, Read1 m, Read a) => Read (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Show e, Show1 m, Show a) => Show (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptGeneric (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Excepttype Rep (ExceptT e m a) = D1 ('MetaDataDefined in transformers-0.6.1.1 · Control.Monad.Trans.Except"ExceptT"
"Control.Monad.Trans.Except"
"transformers-0.6.1.1-a11a"
'True) (C1 ('MetaCons"ExceptT"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (m (Either e a)))))type Rep1 (ExceptT e m) = D1 ('MetaDataDefined in transformers-0.6.1.1 · Control.Monad.Trans.Except"ExceptT"
"Control.Monad.Trans.Except"
"transformers-0.6.1.1-a11a"
'True) (C1 ('MetaCons"ExceptT"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (m :.: Rec1 (Either e))))
The inverse of ExceptT.
Map the unwrapped computation using the given function.
runExceptT (mapExceptT f m) = f (runExceptT m)
Transform any exceptions thrown by the computation using the given function.
Exception operations
5 declarationscatchE finallyE a b executes computation a followed by computation b,
even if a exits early by throwing an exception. In the latter case,
the exception is re-thrown after b has been executed.
Lifting other operations
3 declarationsLift a callCC operation to the new monad.
Lift a listen operation to the new monad.
Lift a pass operation to the new monad.