Portability | non-portable (GHC extensions) |
---|---|
Stability | experimental |
Maintainer | nicolas.frisby@gmail.com |
A monadic interface for resumable exceptions.
- class Monad m => MonadResumable req res m | m -> req res where
- signal :: MonadResumable req res m => req -> m res
- respond :: MonadResumable req res m => (req -> m res) -> m a -> m a
Documentation
class Monad m => MonadResumable req res m | m -> req res whereSource
A monadic interface for resumable exceptions.
yield :: req -> (res -> m a) -> m aSource
Raise the exception: a request and a resumption to use if the request can be handled.
handle :: m a -> (req -> (res -> m a) -> m a) -> m aSource
Installs a handler to quiesce an exception before it percolates to the higher-level handlers.
MonadResumable req res m => MonadResumable req res (ContT r m) | |
(Error e, MonadResumable req res m) => MonadResumable req res (ErrorT e m) | |
MonadResumable req res m => MonadResumable req res (StateT s m) | |
(Monoid w, MonadResumable req res m) => MonadResumable req res (WriterT w m) | |
MonadResumable req res m => MonadResumable req res (ReaderT r m) | |
(Monoid w, MonadResumable req res m) => MonadResumable req res (RWST r w s m) | |
Monad m => MonadResumable req res (ResumableT Dynamic req res m) | |
Monad m => MonadResumable req res (ResumableT Static req res m) |
signal :: MonadResumable req res m => req -> m resSource
Variation on yield
that immediately returns the result.
respond :: MonadResumable req res m => (req -> m res) -> m a -> m aSource
Variation on handle
that always applies the resumption.