Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fun/mod.ts>state.modify

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

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