definitive-base-2.6.3: A small Prelude wrapper to simplify my own Haskell developments
Algebra.Monad.Cont
Contents
Synopsis
class Monad m => MonadCont m where Source #
Minimal complete definition
callCC
Methods
callCC :: (forall b. (a -> m b) -> m b) -> m a Source #
Instances
callCC :: (forall b. (a -> ContT m b) -> ContT m b) -> ContT m a Source #
callCC :: (forall b. (a -> ReaderT r m b) -> ReaderT r m b) -> ReaderT r m a Source #
callCC :: (forall b. (a -> StateT s m b) -> StateT s m b) -> StateT s m a Source #
callCC :: (forall b. (a -> WriterT w m b) -> WriterT w m b) -> WriterT w m a Source #
callCC :: (forall b. (a -> RWST r w s m b) -> RWST r w s m b) -> RWST r w s m a Source #
newtype ContT m a Source #
A simple continuation monad implementation
Constructors
Fields
lift :: Monad m => m a -> ContT m a Source #
pure :: a -> ContT m a Source #
mfix :: (a -> ContT m a) -> ContT m a Source #
join :: ContT m (ContT m a) -> ContT m a Source #
(>>=) :: ContT m a -> (a -> ContT m b) -> ContT m b Source #
(<*>) :: ContT m (a -> b) -> ContT m a -> ContT m b Source #
map :: (a -> b) -> ContT f a -> ContT f b Source #
type Cont a = ContT Id a Source #
contT :: (Monad m, Unit m') => Iso (ContT m a) (ContT m' a') (m a) (m' a') Source #
cont :: Iso (Cont a) (Cont a') a a' Source #
(>>~) :: ContT m a -> (a -> m b) -> m b Source #