rename some things

This commit is contained in:
Joeri Exelmans 2025-04-20 21:09:51 +02:00
parent e04cac4f7d
commit 8a4bd44f04
16 changed files with 92 additions and 60 deletions

View file

@ -1,7 +1,7 @@
import { Unit } from "../primitives/types.js";
import { unit } from "../primitives/unit.js";
import { capitalizeFirstLetter } from "../util/util.js";
import { constructorProduct, getLeft, getRight } from "./product.js";
import { newProduct, getLeft, getRight } from "./product.js";
import { fnType, prodType } from "./types.js";
// 'fields' is an array of (name: string, type: Type) pairs.
@ -26,7 +26,7 @@ export const makeConstructor = fields => {
return nextParam => {
const wrappedName = 'wrapped_' + ret.name;
const newRet = {
[wrappedName]: inner => constructorProduct(nextParam)(ret(inner)),
[wrappedName]: inner => newProduct(nextParam)(ret(inner)),
}[wrappedName];
return internal(nParams-1, newRet);
}