Skip to main content
Module

x/fun/state.ts>modify

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 modify
import { modify } from "https://deno.land/x/fun@v2.0.0-alpha.12/state.ts";

Construct a State<E, void> from a function E => E.

Examples

Example 1

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

const state = S.modify((n: number) => n + 100);

const result = state(1); // [undefined, 101]

Parameters

fee: (e: E) => E