Skip to main content
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.
Go to Latest
function state.modify
import { state } from "https://deno.land/x/fun@v.2.0.0-alpha.11/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