import { tuple } from "https://deno.land/x/fun@v2.0.0-alpha.10/ord.ts";
Derives an Ord from a tuple of Ords. The derived Ord will compare two tuples starting at index 0 and return the first ordering that is non-zero, otherwise the two tuples are equal.
Examples
Example 1
Example 1
import { tuple, lt } from "./ord.ts"
import { OrdNumber } from "./number.ts";
import { OrdString } from "./string.ts";
import { pipe } from "./fn.ts";
const tup = tuple(OrdNumber, OrdString);
const result1 = pipe([1, "a"], lt(tup)([2, "b"])); // true
const result2 = pipe([1, "a"], lt(tup)([1, "b"])); // true
const result3 = pipe([1, "a"], lt(tup)([1, "a"])); // false