... got it wrong
This commit is contained in:
parent
9405ba1b4e
commit
303fa869a8
2 changed files with 6 additions and 10 deletions
|
|
@ -9,13 +9,13 @@ const PointCartesian2D = nominalType(
|
||||||
// just a unique number, to make sure that our type is only equal to itself
|
// just a unique number, to make sure that our type is only equal to itself
|
||||||
"PointCartesian2D")
|
"PointCartesian2D")
|
||||||
// BigInt("0xBBAAD62B10EE21993BA690A732DA2A6875CE4B6F5E7139D5AEC9FD887F9D24A8"))
|
// BigInt("0xBBAAD62B10EE21993BA690A732DA2A6875CE4B6F5E7139D5AEC9FD887F9D24A8"))
|
||||||
(prodType(String, Double));
|
(prodType(Double, Double));
|
||||||
|
|
||||||
const PointPolar2D = nominalType(
|
const PointPolar2D = nominalType(
|
||||||
// just a unique number, to make sure that our type is only equal to itself
|
// just a unique number, to make sure that our type is only equal to itself
|
||||||
"PointPolar2D")
|
"PointPolar2D")
|
||||||
// BigInt("0x31CDAB4B3D84C4EB27D3C111FD7580E533268B72E05BD694F8B262913E018B72"))
|
// BigInt("0x31CDAB4B3D84C4EB27D3C111FD7580E533268B72E05BD694F8B262913E018B72"))
|
||||||
(prodType(String, Double));
|
(prodType(Double, Double));
|
||||||
|
|
||||||
export const cart2polar = ({left: x, right: y}) => {
|
export const cart2polar = ({left: x, right: y}) => {
|
||||||
const r = Math.sqrt(x*x + y*y);
|
const r = Math.sqrt(x*x + y*y);
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,10 @@
|
||||||
import { Type } from "../metacircular.js";
|
import { Type } from "../metacircular.js";
|
||||||
import { Int } from "../primitives/symbols.js";
|
import { String } from "../structures/list_types/string.js";
|
||||||
import { prodType } from "../type_registry.js";
|
import { prodType } from "../type_registry.js";
|
||||||
import { makeProductType } from "./product.js";
|
import { makeProductType } from "./product.js";
|
||||||
|
|
||||||
export const NominalType = prodType(Int, Type);
|
export const NominalType = prodType(String, Type);
|
||||||
|
|
||||||
export const ModuleNominalType = makeProductType(Int, Type);
|
export const ModuleNominalType = makeProductType(String, Type);
|
||||||
|
|
||||||
export const nominalType = x => {
|
export const nominalType = ModuleNominalType.l[5].i; // dirty!!
|
||||||
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