Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Synopsis
- 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.
EMT | |
|
Instances
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 Source # | |
Defined in Control.Monad.Exception.Base |
data NoExceptions Source #
Instances
UncaughtException e => Throws e NoExceptions Source # | |
Defined in Control.Monad.Exception.Base |
data ParanoidMode Source #
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
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
UncaughtException SomeException Source # | |
Defined in Control.Monad.Exception.Base |
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
Instances
Show FailException Source # | |
Defined in Control.Monad.Exception.Base showsPrec :: Int -> FailException -> ShowS # show :: FailException -> String # showList :: [FailException] -> ShowS # | |
Exception FailException Source # | |
Defined in Control.Monad.Exception.Base |
data MonadZeroException Source #
MonadZeroException
is thrown by MonadPlus mzero
Instances
Show MonadZeroException Source # | |
Defined in Control.Monad.Exception.Base showsPrec :: Int -> MonadZeroException -> ShowS # show :: MonadZeroException -> String # showList :: [MonadZeroException] -> ShowS # | |
Exception MonadZeroException Source # | |