Skip to main content
Deno 2 is finally here 🎉️
Learn more
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@v.2.0.0-alpha.11/mod.ts";
const { getEq } = option;

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