Skip to main content
Module

x/fun/state.ts>put

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

Construct a State<E, void> from a static state value E.

Examples

Example 1

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

const state = pipe(
  S.id<number>(),
  S.flatmap(n => pipe(S.id<number>(), S.map(m => m + n))),
);

const result = state(100); // [2, 1]