Skip to main content
Module

x/fun/mod.ts>comparable.record

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

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

Examples

Example 1

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

const { compare } = record(number);

const result1 = compare({ one: 1 })({ one: 2 }); // false
const result2 = compare({ one: 1 })({ one: 1 }); // true

Returns

Comparable<ReadonlyRecord<A>>