fix things

This commit is contained in:
Joeri Exelmans 2025-05-08 23:08:48 +02:00
parent 8a4b47df02
commit 4c394441b0
2 changed files with 7 additions and 6 deletions

View file

@ -4,7 +4,7 @@ import { unit } from "../lib/primitives/unit.js";
import { makeConstructors, makeMatchFn } from "../lib/structures/enum.js";
import { enumType } from "../lib/structures/enum.types.js";
import { newProduct } from "../lib/structures/product.js";
import { lsType } from "../lib/structures/type_constructors.js";
import { lsType } from "../lib/structures/type_constructors.types.js";
import { prettyT } from "../lib/util/pretty.js";
Error.stackTraceLimit = Infinity;
@ -15,10 +15,10 @@ const variants = [
newProduct("not_found")(_ => Unit),
];
const compatibleNestedSumType = enumType(variants);
const structuralType = enumType(variants);
console.log("observe the type that was generated:");
console.log(" ", prettyT(compatibleNestedSumType));
console.log(" ", prettyT(structuralType));
const [newPrice, newPrices, newNotFound] = makeConstructors(variants);
@ -41,7 +41,7 @@ console.log(" ", myEnumToString(price));
console.log(" ", myEnumToString(prices));
console.log(" ", myEnumToString(notFound));
const compareMyEnum = makeCompareFn(compatibleNestedSumType);
const compareMyEnum = makeCompareFn(structuralType);
console.log("observe the generated compare function in action:");
console.log(" should be smaller ->", compareMyEnum(price)(prices));