22 lines
591 B
JavaScript
22 lines
591 B
JavaScript
import { fnType } from "./structures/function.js";
|
|
import { Type } from "./metacircular.js";
|
|
|
|
// Everything is (implicitly) typed by the Any type.
|
|
export const Any = { symbol: Symbol('Any'), params: [] };
|
|
|
|
// A type-link, connecting a value to its Type.
|
|
export const Typed = { symbol: Symbol('Typed'), params: [] };
|
|
|
|
const getInst = lnk => lnk.i;
|
|
const getType = lnk => lnk.t;
|
|
|
|
const Typed_to_Type = fnType({in: Any, out: Type});
|
|
|
|
export const ModuleTyped = {l:[
|
|
{i: Typed, t: Type},
|
|
|
|
{i: Typed_to_Type, t: Type},
|
|
|
|
{i: getInst, t: Typed_to_Type},
|
|
{i: getType, t: Typed_to_Type},
|
|
]};
|