Skip to main content
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.
Go to Latest
import * as fun from "https://deno.land/x/fun@v.2.0.0-alpha.11/predicate.ts";

Variables

The canonical implementation of Contravariant for Predicate. It contains the method contramap.

Functions

Creates the intersection of two predicates, returning true if both predicates return 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.

Get a Monoid<Predicate> for any type A that concats using the Predicate and function and defaults to true.

Get a Monoid<Predicate> for any type A that concats using the Predicate or function and defaults to false.

Get a Semigroup<Predicate> for any type A that concats using the Predicate and function.

Get a Semigroup<Predicate> for any type A that concats 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.

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.