Portability | portable |
---|---|
Stability | provisional |
Maintainer | Edward Kmett <ekmett@gmail.com> |
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.
- type Discont s = DiscontT s Identity
- discont :: (s -> a) -> s -> Discont s a
- runDiscont :: Discont s a -> (s -> a, s)
- data DiscontT s w a = DiscontT (w s -> a) (w s)
- runDiscontT :: DiscontT s w a -> (w s -> a, w s)
- callCV :: DiscontT s w (DiscontT s w (DiscontT s w a -> a) -> b) -> b
- label :: Comonad w => DiscontT s w a -> s
The discontinuation
comonad
The discontinuation comonad transformer
runDiscont :: Discont s a -> (s -> a, s)Source
DiscontT (w s -> a) (w s) |
runDiscontT :: DiscontT s w a -> (w s -> a, w s)Source