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

x/fun/eq.ts>fromEquals

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

Create a Eq from an uncurried function that checks equality.

Examples

Example 1

import { fromEquals } from "./eq.ts";
import { pipe } from "./fn.ts";

const EqNumber = fromEquals<number>(
  (first, second) => first === second
);

const result = pipe(
  1,
  EqNumber.equals(1)
); // true

Parameters

equals: (first: A, second: A) => boolean