- data Handler e m a r = Handler {}
- with :: Monad m => Handler e m a r -> (Proxy (ContT e m) -> ContT e m a) -> m r
- operation :: forall m m' n a r. (m ~ ContT r m', AutoLift m n) => Proxy m -> ((a -> m' r) -> m' r) -> n a
- run :: Cont a a -> a
- runIO :: ContT () IO () -> IO ()
- io :: AutoLift (ContT () IO) n => IO a -> n a
- ioHandler :: Handler a IO a a
- type Cont r = ContT r Identity
- data ContT r m a
- data Proxy m
- class AutoLift m1 m2
Documentation
operation :: forall m m' n a r. (m ~ ContT r m', AutoLift m n) => Proxy m -> ((a -> m' r) -> m' r) -> n aSource
type Cont r = ContT r Identity
Continuation monad.
Cont r a
is a CPS computation that produces an intermediate result
of type a
within a CPS computation whose final result type is r
.
The return
function simply creates a continuation which passes the value on.
The >>=
operator adds the bound function into the continuation chain.
data ContT r m a
The continuation monad transformer. Can be used to add continuation handling to other monads.
AutoLift' m1 m2 n1 n2 => AutoLift' m1 m2 (ContT r1 n1) (ContT r2 n2) | |
(AutoLift' m1 m2 Identity n, Monad m2) => AutoLift' m1 (ContT r m2) Identity (ContT s n) | |
(AutoLift' m1 m2 IO n, Monad m2) => AutoLift' m1 (ContT r m2) IO (ContT s n) | |
MonadTrans (ContT r) | |
Monad (ContT r m) | |
Functor (ContT r m) | |
Applicative (ContT r m) | |
MonadIO m => MonadIO (ContT r m) |