add nominal types for 2D points

This commit is contained in:
Joeri Exelmans 2025-03-20 12:07:31 +01:00
parent 94efde3e65
commit 18b5e56ff0
6 changed files with 110 additions and 21 deletions

40
main.js
View file

@ -100,29 +100,31 @@ const ModuleValues = {l:[
{i: {variant: "L", value: 100n}, t: sumType(Int, Bool)},
]};
import { select } from '@inquirer/prompts';
import { ModulePoint } from "./lib/point.js";
const ctx = new Context({l:[
...ModuleMetaCircular.l,
...ModuleTyped.l,
// ...ModuleConformable,
// ...ModuleConformanceCheckConforms,
// ...ModuleNum,
// ...ModuleEq,
...ModuleBool.l,
...ModuleInt.l,
...ModuleDouble.l,
// ...ModuleSquare,
// ...ModuleList,
...makeIdFn(Int).l,
...makeSquare({i: mulInt, t: Int_to_Int_to_Int}).l,
...makeSquare({i: mulDouble, t: Double_to_Double_to_Double}).l,
...ModuleList.l,
...ModuleValues.l,
...ModuleModule.l,
// ...ModuleMetaCircular.l,
// ...ModuleTyped.l,
// // ...ModuleConformable,
// // ...ModuleConformanceCheckConforms,
// // ...ModuleNum,
// // ...ModuleEq,
// ...ModuleBool.l,
// ...ModuleInt.l,
// ...ModuleDouble.l,
// // ...ModuleSquare,
// // ...ModuleList,
// ...makeIdFn(Int).l,
// ...makeSquare({i: mulInt, t: Int_to_Int_to_Int}).l,
// ...makeSquare({i: mulDouble, t: Double_to_Double_to_Double}).l,
// ...ModuleList.l,
// ...ModuleValues.l,
// ...ModuleModule.l,
...ModulePoint.l,
]});
import { input, select } from '@inquirer/prompts';
const makeChoice = ([i, t]) => {
return {
value: {i, t: t[0]},