Skip to main content
Module

x/fun/fn_either.ts>fromFn

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

Lift a Fn<D, A> into FnEither<[D], never, A>

Examples

Example 1

import { fromFn } from "./fn_either.ts";

const double = (first: number) => first + first;
const lifted = fromFn(double);

const result = lifted(1); // Right(2)