Copyright  (c) Eitan Chatav, 2015 

License  PublicDomain 
Maintainer  eitan.chatav@gmail.com 
Stability  experimental 
Safe Haskell  SafeInferred 
Language  Haskell2010 
The MaybeContT
type and API provide an idiomatic way to handle possibly
failing computations in continuation passing style over some base monad.
 newtype MaybeContT a m r = MaybeContT {
 runMaybeContT :: m a > (r > m a) > m a
 liftMaybeT :: Monad m => MaybeT m r > MaybeContT a m r
 nothingC :: MaybeContT a m r
 mapMaybeContT :: (m a > m a) > MaybeContT a m r > MaybeContT a m r
 withMaybeContTJust :: ((r' > m a) > r > m a) > MaybeContT a m r > MaybeContT a m r'
 withMaybeContTNothing :: (m a > m a) > MaybeContT a m r > MaybeContT a m r
Documentation
newtype MaybeContT a m r Source
The MaybeContT
a
l
m
r
type encodes a nullable monad transformer
in continuation passing style which is monadic in r
. This property holds
for any type constructor m
.
MaybeContT  Construct a continuationpassing computation from a function. 

MonadTrans (MaybeContT a) 

Monad (MaybeContT a m)  The 
Functor (MaybeContT a m)  The 
Applicative (MaybeContT a m)  The 
MonadCont (MaybeContT a m)  Call with current just continuation. 
liftMaybeT :: Monad m => MaybeT m r > MaybeContT a m r Source
liftMaybeT
embeds MaybeT
in MaybeContT
a
.
nothingC :: MaybeContT a m r Source
mapMaybeContT :: (m a > m a) > MaybeContT a m r > MaybeContT a m r Source
Apply a function to transform the result of a continuationpassing computation.
withMaybeContTJust :: ((r' > m a) > r > m a) > MaybeContT a m r > MaybeContT a m r' Source
Apply a function to transform the just continuation passed to a continuationpassing computation.
withMaybeContTNothing :: (m a > m a) > MaybeContT a m r > MaybeContT a m r Source
Apply a function to transform the nothing continuation passed to a continuationpassing computation.