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

x/fun/mod.ts>comparable.nullable

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

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