Skip to main content
Module

x/fun/state.ts>id

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

An instance of Id that makes the State structure a Category. This is often used at the beginning of a State workflow to specify the type of data within a State structure.

Examples

Example 1

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

const num = pipe(
  S.id<number>(),
  S.map(n => n + 1),
);

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