Skip to main content
Module

x/fun/option.ts>getEq

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

Generates a Eq module for an option with inner type of A.

Examples

const Eq = getEq({ equals: (a: number, b: number) => a === b }); const a = Eq.equals(some(1), some(2)); // false const b = Eq.equals(some(1), some(1)); // true const c = Eq.equals(none, none); // true const d = Eq.equals(some(1), none); // false