Skip to main content
Module

x/fun/mod.ts>fn_either.fromFn

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

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)

Parameters

fda: Fn<D, A>