add nominal types for 2D points
This commit is contained in:
parent
94efde3e65
commit
18b5e56ff0
6 changed files with 110 additions and 21 deletions
14
structures/nominal_type.js
Normal file
14
structures/nominal_type.js
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue