Navigation

Scope

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

Computation-scoped handlers via effect rotation.

handlersFromAttrs

Helper to transform an attrset into named handlers.

If attrValue is a function { param, state } it is used directly as handler; If attrValue is a function, resume is f param and preserves state; Otherwise a constant handler always resumes with attrValue, preserving state.

run

Run a computation with scoped handlers. Effects matching handlers are handled inside the scope. Unknown effects rotate outward. The scope's internal state is hidden — caller sees only the body's value.

scope.run : { handlers, state? } -> Computation a -> Computation a

runWith

Like scope.run but exposes the scope's final state alongside the value.

scope.runWith : { handlers, state? } -> Computation a -> Computation { value, state }

stateful

Run a computation with scoped handlers while preserving state around effect rotation.

scope : handlers -> Computation a -> Computation a