Skip to main content
Module

x/fun/eq.ts>Eq

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
interface Eq
import { type Eq } from "https://deno.land/x/fun@v2.0.0-alpha.10/eq.ts";

A Eq is an algebra with a notion of equality. Specifically, a Eq for a type T has an equal method that determines if the two objects are the same. Eqs can be combined, like many algebraic structures. The combinators for Eq in fun can be found in eq.ts.

An instance of a Eq must obey the following laws:

  1. Reflexivity: equals(a)(a) === true
  2. Symmetry: equals(a)(b) === equals(b)(a)
  3. Transitivity: if equals(a)(b) and equals(b)(c), then equals(a)(c)

The original type came from static-land

Properties

readonly
equals: (second: T) => (first: T) => boolean