Module
Control.Comonad.Env
- Package
- purescript-transformers
- Repository
- purescript/purescript-transformers
This module defines the Env
comonad.
Re-exports from Control.Comonad.Env.Class
#ComonadEnv Source
class ComonadEnv :: Type -> (Type -> Type) -> Constraint
class (ComonadAsk e w) <= ComonadEnv e w | w -> e where
The ComonadEnv
type class extends ComonadAsk
with a function
local f x
that allows the value of the local context to be modified for
the duration of the execution of action x
.
An implementation is provided for EnvT
.
Laws:
ask (local f x) = f (ask x)
extract (local _ x) = extract a
extend g (local f x) = extend (g <<< local f) x
Members
local :: forall a. (e -> e) -> w a -> w a
Instances
ComonadEnv e (Tuple e)
(Comonad w) => ComonadEnv e (EnvT e w)
#ask Source
ask :: forall e w a. ComonadAsk e w => w a -> e
#asks Source
asks :: forall e1 e2 w a. ComonadAsk e1 w => (e1 -> e2) -> w a -> e2
Get a value which depends on the environment.
Re-exports from Control.Comonad.Env.Trans
#EnvT Source
newtype EnvT :: forall k. Type -> (k -> Type) -> k -> Type
newtype EnvT e w a
The environment comonad transformer.
This comonad transformer extends the context of a value in the base comonad with a global environment of
type e
.
The ComonadEnv
type class describes the operations supported by this comonad.
Constructors
Instances
Newtype (EnvT e w a) _
(Functor w) => Functor (EnvT e w)
(Extend w) => Extend (EnvT e w)
(Comonad w) => Comonad (EnvT e w)
ComonadTrans (EnvT e)
(Foldable f) => Foldable (EnvT e f)
(Traversable f) => Traversable (EnvT e f)
(FunctorWithIndex i w) => FunctorWithIndex i (EnvT e w)
(FoldableWithIndex i w) => FoldableWithIndex i (EnvT e w)
(TraversableWithIndex i w) => TraversableWithIndex i (EnvT e w)
- Modules
- Control.
Comonad. Env - Control.
Comonad. Env. Class - Control.
Comonad. Env. Trans - Control.
Comonad. Store - Control.
Comonad. Store. Class - Control.
Comonad. Store. Trans - Control.
Comonad. Traced - Control.
Comonad. Traced. Class - Control.
Comonad. Traced. Trans - Control.
Comonad. Trans. Class - Control.
Monad. Cont - Control.
Monad. Cont. Class - Control.
Monad. Cont. Trans - Control.
Monad. Error. Class - Control.
Monad. Except - Control.
Monad. Except. Trans - Control.
Monad. Identity. Trans - Control.
Monad. List. Trans - Control.
Monad. Maybe. Trans - Control.
Monad. RWS - Control.
Monad. RWS. Trans - Control.
Monad. Reader - Control.
Monad. Reader. Class - Control.
Monad. Reader. Trans - Control.
Monad. State - Control.
Monad. State. Class - Control.
Monad. State. Trans - Control.
Monad. Trans. Class - Control.
Monad. Writer - Control.
Monad. Writer. Class - Control.
Monad. Writer. Trans