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

x/fun/mod.ts>state.of

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

Construct a State<E, A> from a static value A.

Examples

Example 1

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

const state = S.of(1);

const result = state(null); // [1, null]

Type Parameters

A
optional
E = unknown