LIO.MonadCatch
Description
This module generalizes throw
and catch
(from
Control.Exception) to methods that can be defined on multiple
Monads.
- class Monad m => MonadCatch m where
- genericBracket :: MonadCatch m => (m b -> m c -> m b) -> m a -> (a -> m c) -> (a -> m b) -> m b
Documentation
class Monad m => MonadCatch m whereSource
MonadCatch
is the class used to generalize the standard IO
catch
and throwIO
functions to methods that can be defined in
multiple monads.
Methods
throwIO :: Exception e => e -> m aSource
catch :: Exception e => m a -> (e -> m a) -> m aSource
handle :: Exception e => (e -> m a) -> m a -> m aSource
onException :: m a -> m b -> m aSource
Instances
MonadCatch IO | |
Label l => MonadCatch (LIO l s) |
Arguments
:: MonadCatch m | |
=> (m b -> m c -> m b) | On exception function |
-> m a | Action to perform before |
-> (a -> m c) | Action for afterwards |
-> (a -> m b) | Main (in between) action |
-> m b | Result of main action |