category-extras-0.44.4: Various modules and constructs inspired by category theory

Portabilitynon-portable (MPTCs)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Comonad.Context

Description

The state-in-context comonad and comonad transformer

Documentation

class Comonad w => ComonadContext s w | w -> s whereSource

Methods

getC :: w a -> sSource

modifyC :: (s -> s) -> w a -> aSource

Instances

putC :: ComonadContext s w => s -> w a -> aSource

experiment :: (ComonadContext s w, Functor f) => f (s -> s) -> w a -> f aSource

data Context s a Source

Constructors

Context (s -> a) s 

runContext :: (Context s s -> Context s b) -> s -> (b, s)Source

newtype ContextT s w a Source

Constructors

ContextT 

Fields

runContextT :: (w s -> a, w s)
 

Instances