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@v.2.0.0-alpha.11/option.ts";

Create an instance of Eq<Option> given an instance of Eq.

Examples

Example 1

import * as O from "./option.ts";
import * as N from "./number.ts";

const Eq = O.getEq(N.EqNumber);

const result1 = Eq.equals(O.some(1))(O.some(2)); // false
const result2 = Eq.equals(O.some(1))(O.some(1)); // true
const result3 = Eq.equals(O.none)(O.none); // true
const result4 = Eq.equals(O.some(1))(O.none); // false