big part of the code base still needs to be 'ported' to the updated type constructors.
19 lines
623 B
JavaScript
19 lines
623 B
JavaScript
import { typedFnType } from "../structures/types.js";
|
|
import { Top, Type } from "./types.js";
|
|
import { makeTypeConstructor } from "../type_constructor.js";
|
|
|
|
// A type-link, connecting a value to its Type.
|
|
export const symbolDynamic = Symbol('Dynamic');
|
|
export const Dynamic = makeTypeConstructor(symbolDynamic)(0);
|
|
|
|
export const getInst = lnk => lnk.i;
|
|
export const getType = lnk => lnk.t;
|
|
|
|
export const ModuleDynamic = {l:[
|
|
{i: Dynamic, t: Type},
|
|
{i: Top , t: Type},
|
|
|
|
...typedFnType(getInst, fnType => fnType(() => Dynamic)(() => Top)),
|
|
...typedFnType(getType, fnType => fnType(() => Dynamic)(() => Top)),
|
|
]};
|
|
|