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

View file

@ -0,0 +1,14 @@
import { Type } from "../metacircular.js";
import { Int } from "../primitives/symbols.js";
import { prodType } from "../type_registry.js";
import { makeProductType } from "./product.js";
export const NominalType = prodType(Int, Type);
export const ModuleNominalType = makeProductType(Int, Type);
export const nominalType = x => {
const result = ModuleNominalType.l[5].i(x); // dirty!!
result.__proto__.toString = () => "HEY";
return result;
}