Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/mod.ts>state.id

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.id
import { state } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { id } = state;

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]