recursive types (and operations on them, like pretty-printing, comparison and unification) seem to be working.

big part of the code base still needs to be 'ported' to the updated type constructors.
This commit is contained in:
Joeri Exelmans 2025-05-05 17:17:45 +02:00
parent 55c5d7cffa
commit 8eec5b9239
34 changed files with 523 additions and 295 deletions

View file

@ -19,7 +19,7 @@ export class RBTreeWrapper {
// (a -> a -> Int) -> Set(a)
export const emptySet = compareFn => new RBTreeWrapper(createRBTree((x, y) => compareFn(x)(y)));
// const emptySetType = makeGeneric(a => fnType(fnType(a)(fnType(a)(Int)))(setType(a)));
// const emptySetType = makeGeneric(a => fnType(() => fnType(a)(fnType(a)(Int)))(() => set(() => a)));
export const has = set => key => set.tree.get(key) === true;
export const add = set => key => set.tree.get(key) === true ? set : new RBTreeWrapper(set.tree.insert(key, true));
@ -57,7 +57,7 @@ export const ModuleSet = {l:[
// ...typedFnType(has, fnType =>
// makeGeneric(a =>
// fnType
// /* in */ (setType(a))
// /* in */ (set(() => a))
// /* out */ (fnType
// /* in */ (a)
// /* out */ (Bool)
@ -66,9 +66,9 @@ export const ModuleSet = {l:[
// ...typedFnType(add, fnType =>
// makeGeneric(a =>
// fnType
// /* in */ (setType(a))
// /* in */ (set(() => a))
// /* out */ (fnType
// /* in */ (a)
// /* out */ (setType(a))
// /* out */ (set(() => a))
// )), GenericType),
]};