can auto-generate comparison functions for composed types

This commit is contained in:
Joeri Exelmans 2025-04-17 16:43:28 +02:00
parent 0b262daf7f
commit 4d1fb81492
6 changed files with 72 additions and 35 deletions

View file

@ -1,8 +1,10 @@
import { compareNumbers } from "./primitives.js"
import { length as lengthLs } from "../structures/list.js";
import { get, length as lengthLs } from "../structures/list.js";
import { read, length as lengthSet } from "../structures/set.js";
import { constructorProduct, getLeft, getRight } from "../structures/product.js";
import { match } from "../structures/sum.js";
import { makeGeneric } from "../generics/generics.js";
import { lsType } from "../structures/types.js";
// (a -> a -> Int) -> [a] -> [a] -> Int
export const compareLists = compareElems => x => y => {