simplify: no distinction between generic types and 'normal' types.

This commit is contained in:
Joeri Exelmans 2025-05-08 16:58:07 +02:00
parent b4826605af
commit a664ddac8a
27 changed files with 535 additions and 360 deletions

View file

@ -1,12 +1,17 @@
// Total ordering of composed types
import { compareNumbers } from "./primitives.js"
import { compareNumbers, compareStrings } from "./primitives.js"
import { get, length as lengthLs } from "../structures/list.js";
import { read as readSet, length as lengthSet, first as firstSet } from "../structures/set.js";
import { read as readDict, length as lengthDict, first as firstDict } from "../structures/dict.js";
import { getLeft, getRight } from "../structures/product.js";
import { match } from "../structures/sum.js";
export const compareFunctions = _compareInput => _compareOutput => x => y => {
// dirty but does the job
return compareStrings(x.toString())(y.toString());
}
export const compareLists = compareElems => x => y => {
return compareNumbers(lengthLs(x))(lengthLs(y))
|| (() => {