Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Comparable

import type { Comparable } from "https://raw.githubusercontent.com/baetheus/fun/main/comparable.ts";

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

An instance of a Comparable must obey the following laws:

  1. Reflexivity: compare(a, a) === true
  2. Symmetry: compare(a, b) === compare(b, a)
  3. Transitivity: if compare(a, b) and compare(b, c), then compare(a, c)
interface Comparable <A> extends Hold<A> {
readonly compare: Compare<A>;
}

§Type Parameters

§Extends

§Properties

§
readonly compare: Compare<A>
[src]