Skip to main content
Module

x/fun/mod.ts>comparable.array

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function comparable.array
import { comparable } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { array } = comparable;

Creates a Comparable that compares readonly array with items that have the type compared in the supplied eq.

Examples

Example 1

import { array, number } from "./comparable.ts";

const { compare } = array(number);

const result1 = compare([1, 2])([1, 2, 3]); // false
const result2 = compare([1, 2])([1, 2]); // true

Returns

Comparable<ReadonlyArray<A>>