Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/state.ts>evaluate

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function evaluate
import { evaluate } from "https://deno.land/x/fun@v2.0.0/state.ts";

Extract the result value A by executing State<S, A> with an S value.

Examples

Example 1

import * as S from "./state.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  S.id<number>(),
  S.map(n => n + 1),
  S.evaluate(10),
); // 11

Returns

<A>(ta: State<S, A>) => A