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

x/fun/mod.ts>set.getComparableSet

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

Given an instance of Comparable return Comparable<ReadonlySet>.

Examples

Example 1

import * as S from "./set.ts";
import * as N from "./number.ts";
import { pipe } from "./fn.ts";

const { compare } = S.getComparableSet(N.ComparableNumber);

const result1 = compare(
  S.set(1, 2, 3))(
  S.set(3, 2, 1)
); // true
const result2 = compare(
  S.set(1, 2, 3))(
  S.set(1, 2, 3, 4)
); // false

Parameters

S: Comparable<A>

Returns

Comparable<ReadonlySet<A>>