Skip to main content
Module

x/fun/mod.ts>state.gets

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

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

Examples

Example 1

import * as S from "./state.ts";

const length = S.gets((s: string) => s.length);

const result = length("Hello World"); // [11, "Hello World"]

Parameters

fea: (e: E) => A