Control.Effect.Reader
data Reader r :: Effect where Source #
The Reader r effect provides access to a global environment of type r.
Reader r
Reader
r
Handlers should obey the law f <$> ask ≡ local f ask.
f <$> ask
<$>
ask
local f ask
local
Constructors
ask :: Reader r :< effs => Eff effs r Source #
Retrieves a value from the environment.
local :: Reader r1 :< effs => (r1 -> r2) -> Eff (Reader r2 ': effs) a -> Eff effs a Source #
Runs a subcomputation in an environment modified by the given function.
runReader :: r -> Eff (Reader r ': effs) a -> Eff effs a Source #
Handles a Reader effect by supplying a value for the environment.