Skip to main content
Module

x/fun/state.ts>execute

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function execute
import { execute } from "https://deno.land/x/fun@v.2.0.0-alpha.11/state.ts";

Extract the ending state value S 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.execute(10),
); // 10

Returns

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