category-extras-0.53.5: Various modules and constructs inspired by category theorySource codeContentsIndex
Control.Comonad.Reader
Portabilityportable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
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
data Coreader r a Source
Constructors
Coreader r a
show/hide Instances
runCoreader :: Coreader r a -> (r, a)Source
newtype CoreaderT w r a Source
Constructors
CoreaderT
runCoreaderT :: w (r, a)
show/hide Instances
class Comonad w => ComonadReader r w | w -> r whereSource
Methods
askC :: w a -> rSource
show/hide Instances
Produced by Haddock version 2.4.2