Skip to main content
Module

x/fun/fn.ts>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 of
import { of } from "https://deno.land/x/fun@v2.0.0-alpha.6/fn.ts";

Create a Fn that always returns a value. This is equivalent to constant.

Examples

Example 1

import { of } from "./fn.ts";

const alwaysA = of("A");

const result = alwaysA(null); // "A"

Type Parameters

A
optional
D = unknown