Skip to main content
Module

x/fun/comparable.ts>nullable

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

Creates a derivative Comparable that can also compare null values in addition to the source eq.

Examples

Example 1

import { nullable, number } from "./comparable.ts";

const { compare } = nullable(number);

const result1 = compare(1)(null); // false
const result2 = compare(null)(null); // true