type Cont r = ContT r Identity { } #
newtype ContT r m a { } #
ContT { runContT :: (a -> m r) -> m r }
The continuation monad transformer.
class Monad m => MonadCont m { } #

Methods

callCCM :: ((a -> m b) -> m a) -> m a
Class of monads that support callCC.
cont :: ((a -> r) -> r) -> Cont r a { } #
Construct a continuation.
runCont :: (Cont r a) -> (a -> r) -> r { } #
Run a continuation with a final continuation.
evalCont :: (Cont r r) -> r { } #
Evaluate a continuation using id as the final continuation.
mapCont :: (r -> r) -> (Cont r a) -> Cont r a { } #
Map the result of a continuation.
withCont :: ((b -> r) -> a -> r) -> (Cont r a) -> Cont r b { } #
Transform the continuation.
<*> :: { } #
>>= :: { } #
evalContT :: (Monad m) => (ContT r m r) -> m r { } #
Evaluate a continuation using return as the final continuation.
mapContT :: ((m r) -> m r) -> (ContT r m a) -> ContT r m a { } #
Map the result of a continuation.
withContT :: ((b -> m r) -> a -> m r) -> (ContT r m a) -> ContT r m b { } #
Transform the continuation.
callCC :: ((a -> ContT r m b) -> ContT r m a) -> ContT r m a { } #
Call with current continuation.
reset :: (Monad m) => (ContT r m r) -> ContT r' m r { } #
Delimit the continuation.
shift :: (Monad m) => ((a -> m r) -> ContT r m r) -> ContT r m a { } #
Capture the delimited continuation.
instance Functor (ContT r m) { }
instance MonadTrans (ContT r) { }
instance MonadIO m => MonadIO (ContT r m) { }
instance MonadCont (ContT r m) { }
instance MonadCont (Cont r) { }