comonad-transformers-0.6.2: Haskell 98 comonad transformers

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Comonad.Trans.Discont.Lazy

Contents

Description

Discont is the Density comonad of a constant functor, just as Cont is a Codensity monad of a constant functor.

Note that Discont and Context are isomorphic, but DiscontT and ContextT are not.

Synopsis

The discontinuation comonad

discont :: (s -> a) -> s -> Discont s aSource

The discontinuation comonad transformer

runDiscont :: Discont s a -> (s -> a, s)Source

data DiscontT s w a Source

Constructors

DiscontT (w s -> a) (w s) 

runDiscontT :: DiscontT s w a -> (w s -> a, w s)Source

Combinators

callCV :: DiscontT s w (DiscontT s w (DiscontT s w a -> a) -> b) -> bSource

label :: Comonad w => DiscontT s w a -> sSource