Skip to main content
Module

x/fun/mod.ts>eq.undefinable

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 eq.undefinable
import { eq } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { undefinable } = eq;

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

Examples

Example 1

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

const { equals } = undefinable(number);

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

Returns

Eq<A | undefined>