Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fun/predicate.ts>not

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

Negates the result of an existing Predicate.

Examples

Example 1

import { not } from "./predicate.ts";

const isPositive = (n: number) => n > 0;
const isZeroOrNegative = not(isPositive);

const result1 = isZeroOrNegative(1); // false
const result2 = isZeroOrNegative(0); // true
const result3 = isZeroOrNegative(-1); // true