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

x/fun/predicate.ts

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

The Predicate type represents unary functions that return boolean values. Typically, these functions indicate the existence of some quality for the values passed as inputs. Some simple examples of Predicates are postive for numbers, non-null values, etc.

Functions

Creates the intersection of two predicates, returning true if both predicates return true.

Get a Initializable<Predicate> for any type A that combines using the Predicate and function.

Get a Initializable<Predicate> for any type A that combines using the Predicate or function.

Negates the result of an existing Predicate.

Creates the union of two predicates, returning true if either predicate returns true.

Create a Predicate using a Predicate and a function that takes a type L and returns a type D. This maps over the input value of the predicate.

Interfaces

Specifies Predicate as a Higher Kinded Type, with contravariant parameter A corresponding to the 0th index of any Substitutions.

Type Aliases

The Predicate type is a function that takes some value of type A and returns boolean, indicating that a property is true or false for the value A.