Skip to content

evaluate

evaluate<S>(initialState): <A>(st) => A

Defined in: Core/State.ts:202

Runs a State computation with an initial state, returning only the produced value (discarding the final state).

S

S

<A>(st): A

A

State<S, A>

A

State.evaluate([])(pipe(
  State.modify<string[]>(s => [...s, "x"]),
  State.chain(() => State.get<string[]>()),
)); // ["x"]