Skip to main content
Module

x/fun/mod.ts>set.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 set.getEq
import { set } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { getEq } = set;

Given an instance of Eq return Eq<ReadonlySet>.

Examples

Example 1

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

const { equals } = S.getEq(N.EqNumber);

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

Returns

Eq<ReadonlySet<A>>