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

Portabilityportable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Comonad.Reader

Description

If you look at the reader arrow: (e, a) -> a you can see that all the interesting bits are bunched on the left. This is that comonad. Flipping the pair and currying the arguments yields a -> (e -> a), and you can recognize the (e -> a) as the reader monad. In more technical language the Reader comonad is left adjoint to the Reader monad.

Documentation

runCoreader :: Coreader r a -> (r, a)Source

newtype CoreaderT w r a Source

Constructors

CoreaderT 

Fields

runCoreaderT :: w (r, a)
 

class Comonad w => ComonadReader r w | w -> r whereSource

Methods

askC :: w a -> rSource

Instances