import { tuple } from "https://deno.land/x/fun@v2.0.0-alpha.12/sortable.ts";
Derives an Sortable from a tuple of Sortables. The derived Sortable 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 "./sortable.ts"
import { SortableNumber } from "./number.ts";
import { SortableString } from "./string.ts";
import { pipe } from "./fn.ts";
const tup = tuple(SortableNumber, SortableString);
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