# Reader


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

## `ask`

_ask: read the current environment threaded by the reader handler; impure request whose response IS the handler state._

```
ask : Computation env
```

Read the current environment.

## `asks`

_asks: read a projection of the environment via a user-supplied function; sugar for `bind ask (env: pure (f env))`._

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

Read a projection of the environment.

## `handler`

_reader.handler: interprets ask/local effects with state IS the (immutable) environment; ask resumes with state, local replaces it._

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

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

## `local`

_local: run a sub-computation under a modifier-transformed environment; sends `local` so handlers can install the modified env._

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

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.

