category-extras-0.53.6: Various modules and constructs inspired by category theoryContentsIndex
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
Constructors
Coreader r a
show/hide Instances
runCoreader :: Coreader r a -> (r, a)
newtype CoreaderT w r a
Constructors
CoreaderT
runCoreaderT :: w (r, a)
show/hide Instances
Comonad w => ComonadReader r (CoreaderT w r)
ComonadCofree f w => ComonadCofree f (CoreaderT w e)
Functor f => QFunctor (CoreaderT f) Hask Hask
Functor f => PFunctor (CoreaderT f) Hask Hask
Functor f => Bifunctor (CoreaderT f) Hask Hask Hask
Functor f => Functor (CoreaderT f b)
Copointed w => Copointed (CoreaderT w b)
Comonad w => Comonad (CoreaderT w b)
class Comonad w => ComonadReader r w | w -> r where
Methods
askC :: w a -> r
show/hide Instances
Produced by Haddock version 2.1.0