Skip to main content
Module

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

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