MonadCatchIO-mtl-0.3.0.1: Monad-transformer version of the Control.Exception moduleSource codeContentsIndex
Control.Monad.CatchIO
Synopsis
class MonadIO m => MonadCatchIO m where
catch :: Exception e => m a -> (e -> m a) -> m a
block :: m a -> m a
unblock :: m a -> m a
Exception (toException, fromException)
throw :: (MonadIO m, Exception e) => e -> m a
try :: (MonadCatchIO m, Exception e) => m a -> m (Either e a)
tryJust :: (MonadCatchIO m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)
onException :: MonadCatchIO m => m a -> m b -> m a
bracket :: MonadCatchIO m => m a -> (a -> m b) -> (a -> m c) -> m c
bracket_ :: MonadCatchIO m => m a -> m b -> m c -> m c
finally :: MonadCatchIO m => m a -> m b -> m a
bracketOnError :: MonadCatchIO m => m a -> (a -> m b) -> (a -> m c) -> m c
data Handler m a = forall e . Exception e => Handler (e -> m a)
catches :: MonadCatchIO m => m a -> [Handler m a] -> m a
Documentation
class MonadIO m => MonadCatchIO m whereSource
Methods
catch :: Exception e => m a -> (e -> m a) -> m aSource
Generalized version of catch
block :: m a -> m aSource
Generalized version of block
unblock :: m a -> m aSource
Generalized version of unblock
show/hide Instances
Exception (toException, fromException)
throw :: (MonadIO m, Exception e) => e -> m aSource
Generalized version of throwIO
try :: (MonadCatchIO m, Exception e) => m a -> m (Either e a)Source
Generalized version of try
tryJust :: (MonadCatchIO m, Exception e) => (e -> Maybe b) -> m a -> m (Either b a)Source
Generalized version of tryJust
onException :: MonadCatchIO m => m a -> m b -> m aSource
Generalized version of onException
bracket :: MonadCatchIO m => m a -> (a -> m b) -> (a -> m c) -> m cSource
Generalized version of bracket
bracket_Source
:: MonadCatchIO m
=> m acomputation to run first ("acquire resource")
-> m bcomputation to run last ("release resource")
-> m ccomputation to run in-between
-> m c
A variant of bracket where the return value from the first computation is not required.
finallySource
:: MonadCatchIO m
=> m acomputation to run first
-> m bcomputation to run afterward (even if an exception was raised)
-> m a
A specialised variant of bracket with just a computation to run afterward.
bracketOnErrorSource
:: MonadCatchIO m
=> m acomputation to run first ("acquire resource")
-> a -> m bcomputation to run last ("release resource")
-> a -> m ccomputation to run in-between
-> m c
Like bracket, but only performs the final action if there was an exception raised by the in-between computation.
data Handler m a Source
Generalized version of Handler
Constructors
forall e . Exception e => Handler (e -> m a)
catches :: MonadCatchIO m => m a -> [Handler m a] -> m aSource
Generalized version of catches
Produced by Haddock version 2.4.2