Skip to main content
Module

x/fun/mod.ts>comparable.undefinable

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

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

Examples

Example 1

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

const { compare } = undefinable(number);

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

Returns

Comparable<A | undefined>