Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/mod.ts>array.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 array.getEq
import { array } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { getEq } = array;

Given an instance Eq create a Eq<ReadonlyArray>.

Examples

Example 1

import * as A from "./array.ts";
import { EqNumber } from "./number.ts";
import { pipe } from "./fn.ts";

const { equals } = A.getEq(EqNumber);

const result1 = pipe([1, 2, 3], equals([1, 2, 3])); // true
const result2 = pipe(A.empty(), equals([1, 2, 3])); // false
const result3 = pipe([1, 2], equals([2, 1])); // false

Returns

Eq<ReadonlyArray<A>>