Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/fun/mod.ts>either.fromPredicate

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

Type Parameters

A
B extends A

Parameters

refinement: Refinement<A, B>

Returns

(a: A) => Either<A, B>

Parameters

predicate: Predicate<A>

Returns

(a: A) => Either<A, A>