| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Control.Monad.Exception.Base
- type CallTrace = [String]
- newtype EMT l m a = EMT {
- unEMT :: m (Either (CallTrace, CheckedException l) a)
- tryEMT :: Monad m => EMT AnyException m a -> m (Either SomeException a)
- tryEMTWithLoc :: Monad m => EMT AnyException m a -> m (Either (CallTrace, SomeException) a)
- runEMTGen :: forall l m a. Monad m => EMT l m a -> m a
- data AnyException
- data NoExceptions
- data ParanoidMode
- runEMT :: Monad m => EMT NoExceptions m a -> m a
- runEMTParanoid :: Monad m => EMT ParanoidMode m a -> m a
- throw :: (Exception e, Throws e l, Monad m) => e -> EMT l m a
- rethrow :: (Throws e l, Monad m) => CallTrace -> e -> EMT l m a
- showExceptionWithTrace :: Exception e => [String] -> e -> String
- class Exception e => UncaughtException e
- type EM l = EMT l Identity
- tryEM :: EM AnyException a -> Either SomeException a
- tryEMWithLoc :: EM AnyException a -> Either (CallTrace, SomeException) a
- runEM :: EM NoExceptions a -> a
- runEMParanoid :: EM ParanoidMode a -> a
- data FailException = FailException String
- data MonadZeroException = MonadZeroException
- mplusDefault :: Monad m => EMT l m a -> EMT l m a -> EMT l m a
- mapLeft :: (a -> b) -> Either a r -> Either b r
Documentation
A Monad Transformer for explicitly typed checked exceptions.
Constructors
| EMT | |
Fields
| |
Instances
| (Exception e, Throws e l, Monad m) => Failure e (EMT l m) | |
| MonadBase b m => MonadBase b (EMT l m) | |
| MonadBaseControl b m => MonadBaseControl b (EMT l m) | |
| (Exception e, MonadBaseControl IO m) => MonadCatch e (EMT (Caught e l) m) (EMT l m) | |
| (Exception e, Monad m) => MonadCatch e (EMT (Caught e l) m) (EMT l m) | |
| Throws MonadZeroException l => Alternative (EM l) | |
| Throws MonadZeroException l => MonadPlus (EM l) | |
| MonadTrans (EMT l) | |
| MonadTransControl (EMT l) | |
| Monad m => Monad (EMT l m) | |
| Monad m => Functor (EMT l m) | |
| MonadFix m => MonadFix (EMT l m) | |
| Monad m => Applicative (EMT l m) | |
| Monad m => MonadLoc (EMT l m) | |
| MonadIO m => MonadIO (EMT l m) | |
| type StT (EMT l) a = Either (CallTrace, CheckedException l) a | |
| type StM (EMT l m) a = ComposeSt (EMT l) m a |
tryEMT :: Monad m => EMT AnyException m a -> m (Either SomeException a) Source
Run a computation explicitly handling exceptions
tryEMTWithLoc :: Monad m => EMT AnyException m a -> m (Either (CallTrace, SomeException) a) Source
data AnyException Source
Instances
| Exception e => Throws e AnyException |
data NoExceptions Source
Instances
| UncaughtException e => Throws e NoExceptions |
data ParanoidMode Source
runEMT :: Monad m => EMT NoExceptions m a -> m a Source
Run a safe computation
runEMTParanoid :: Monad m => EMT ParanoidMode m a -> m a Source
Run a safe computation checking even unchecked (UncaughtException) exceptions
rethrow :: (Throws e l, Monad m) => CallTrace -> e -> EMT l m a Source
Rethrow an exception keeping the call trace
showExceptionWithTrace :: Exception e => [String] -> e -> String Source
class Exception e => UncaughtException e Source
UncaughtException models unchecked exceptions
In order to declare an unchecked exception E, all that is needed is to make e an instance of UncaughtException
instance UncaughtException E
Note that declaring an exception E as unchecked does not automatically turn its children unchecked too. This is a shortcoming of the current encoding.
Instances
tryEM :: EM AnyException a -> Either SomeException a Source
Run a computation explicitly handling exceptions
tryEMWithLoc :: EM AnyException a -> Either (CallTrace, SomeException) a Source
runEM :: EM NoExceptions a -> a Source
Run a safe computation
runEMParanoid :: EM ParanoidMode a -> a Source
Run a computation checking even unchecked (UncaughtExceptions) exceptions
data FailException Source
FailException is thrown by Monad fail
Constructors
| FailException String |
Instances
data MonadZeroException Source
MonadZeroException is thrown by MonadPlus mzero
Constructors
| MonadZeroException |