Reference
Auto-generated API reference from nix-effects source.

Reader

Read-only environment effect: ask/asks/local with standard handler.

ask

Read the current environment.

ask : Computation env

asks

Read a projection of the environment.

asks : (env -> a) -> Computation a

handler

Standard reader handler. Interprets ask effects. The state IS the environment (immutable through the computation).

handle { handlers = reader.handler; state = myEnv; } comp

local

Run a computation with a modified environment. Returns a new computation that transforms the environment before executing the inner computation.

Since handlers are pure functions, local is implemented by wrapping the inner computation's ask effects with the modifier. In practice, use separate handler installation with the modified env.

local : (env -> env) -> Computation a -> Computation a