Module
Control.Comonad.Env.Class
- Package
- transformers
- Repository
- purescript/purescript-transformers
This module defines the ComonadEnv
type class and its instances.
#ComonadAsk Source
class ComonadAsk :: Type -> (Type -> Type) -> Constraint
class (Comonad w) <= ComonadAsk e w | w -> e where
The ComonadEnv
type class represents those comonads which support a
global environment that can be provided via the ask
function.
An implementation is provided for EnvT
.
Members
ask :: forall a. w a -> e
Instances
ComonadAsk e (Tuple e)
(Comonad w) => ComonadAsk e (EnvT e w)
#asks Source
asks :: forall e1 e2 w a. ComonadAsk e1 w => (e1 -> e2) -> w a -> e2
Get a value which depends on the environment.
#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)
- 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