Interface Eq<Lhs, Rhs>

All instances of Eq must satisfy the following conditions:

  • Symmetric: Eq<A, B> always equals to Eq<B, A>.
  • Transitive: Eq<A, B> and Eq<B, C> always implies Eq<A, C>.
  • Reflexive: Passing two same values to Eq<A, A> always returns true.

For example, the comparator below cannot implement Eq because that does not satisfy reflexive due to NaN === NaN always be false.

import { PartialEq } from "./partial-eq.ts";

const numPartialEq: PartialEq<number, number> = {
eq: (x, y) => x === y,
};

Type Parameters

  • Lhs

  • Rhs = Lhs

Hierarchy

Properties

Properties

[eqSymbol]: true
eq: ((l, r) => boolean)

Type declaration

    • (l, r): boolean
    • Parameters

      • l: Lhs
      • r: Rhs

      Returns boolean

Generated using TypeDoc