adjunctions-4.4: Adjunctions and representable functors

Copyright(C) 2011-2013 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
PortabilityMPTCs, fundeps
Safe HaskellSafe
LanguageHaskell98

Control.Monad.Trans.Conts

Contents

Description

Cont r ~ Contravariant.Adjoint (Op r) (Op r)
Conts r ~ Contravariant.AdjointT (Op r) (Op r)
ContsT r w m ~ Contravariant.AdjointT (Op (m r)) (Op (m r)) w

Synopsis

Continuation passing style

cont :: ((a -> r) -> r) -> Cont r a Source #

runCont :: Cont r a -> (a -> r) -> r Source #

Multiple-continuation passing style

type Conts r w = ContsT r w Identity Source #

runConts :: Functor w => Conts r w a -> w (a -> r) -> r Source #

conts :: Functor w => (w (a -> r) -> r) -> Conts r w a Source #

Multiple-continuation passing style transformer

newtype ContsT r w m a Source #

Constructors

ContsT 

Fields

Instances

Comonad w => MonadTrans (ContsT r w) Source # 

Methods

lift :: Monad m => m a -> ContsT r w m a #

Comonad w => Monad (ContsT r w m) Source # 

Methods

(>>=) :: ContsT r w m a -> (a -> ContsT r w m b) -> ContsT r w m b #

(>>) :: ContsT r w m a -> ContsT r w m b -> ContsT r w m b #

return :: a -> ContsT r w m a #

fail :: String -> ContsT r w m a #

Functor w => Functor (ContsT r w m) Source # 

Methods

fmap :: (a -> b) -> ContsT r w m a -> ContsT r w m b #

(<$) :: a -> ContsT r w m b -> ContsT r w m a #

Comonad w => Applicative (ContsT r w m) Source # 

Methods

pure :: a -> ContsT r w m a #

(<*>) :: ContsT r w m (a -> b) -> ContsT r w m a -> ContsT r w m b #

liftA2 :: (a -> b -> c) -> ContsT r w m a -> ContsT r w m b -> ContsT r w m c #

(*>) :: ContsT r w m a -> ContsT r w m b -> ContsT r w m b #

(<*) :: ContsT r w m a -> ContsT r w m b -> ContsT r w m a #

Comonad w => Apply (ContsT r w m) Source # 

Methods

(<.>) :: ContsT r w m (a -> b) -> ContsT r w m a -> ContsT r w m b #

(.>) :: ContsT r w m a -> ContsT r w m b -> ContsT r w m b #

(<.) :: ContsT r w m a -> ContsT r w m b -> ContsT r w m a #

liftF2 :: (a -> b -> c) -> ContsT r w m a -> ContsT r w m b -> ContsT r w m c #

callCC :: Comonad w => ((a -> ContsT r w m b) -> ContsT r w m a) -> ContsT r w m a Source #