# State


The trampoline deepSeq-forces handler state at each step;
derivations and other cyclic attrsets hang. `mkThunk` wraps a
value as `{ _tag = "Thunk"; _force = _: value; }` — Nix never
recurses into a closure environment, so deepSeq sees only the
inert tag and closure. Wrap before storing; unwrap with
`forceThunk` after `fx.run`/`fx.handle` returns.

## Sub-namespaces

- [`thunk`](/nix-effects/core-api/state/thunk)

## Source

- [`src/state/thunk.nix`](https://github.com/kleisli-io/nix-effects/blob/main/src/state/thunk.nix)

