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

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

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