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

@ -14,7 +14,7 @@ export const structType = fields => {
}
const [field, ...rest] = fields;
const fieldType = getRight(field);
return prodType(fieldType)(structType(rest));
return prodType(() => fieldType)(() => structType(rest));
};
export const makeConstructor = fields => {
@ -41,7 +41,7 @@ export const makeConstructorType = type => fields => {
}
const [field, ...rest] = fields;
const fieldType = getRight(field);
return fnType(fieldType)(makeConstructorType(rest));
return fnType(() => fieldType)(() => makeConstructorType(rest));
};
export const makeGetters = fields => {
@ -60,6 +60,6 @@ export const makeGetters = fields => {
export const makeGettersTypes = type => fields => {
return fields.map(field => {
const fieldType = getRight(field);
return fnType(type)(fieldType);
return fnType(() => type)(() => fieldType);
});
};