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

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

Control.Comonad.Context

Description

The Context Comonad Transformer is related to the left Kan Extension Lan of a comonad along itself, except the type of the context is fixed, and not existentially quantified.

Documentation

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

Methods

getC :: w a -> sSource

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

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