progress and some refactoring

This commit is contained in:
Joeri Exelmans 2025-03-31 15:35:02 +02:00
parent d236eca5e5
commit d8ca2f3999
25 changed files with 376 additions and 163 deletions

View file

@ -1,9 +1,17 @@
// to break up dependency cycles, primitive types are defined in their own JS module
export const Int = { symbol: Symbol('Int') , params: [] };
export const Bool = { symbol: Symbol('Bool') , params: [] };
export const Double = { symbol: Symbol('Double'), params: [] };
export const Byte = { symbol: Symbol('Byte') , params: [] };
export const Char = { symbol: Symbol('Char') , params: [] };
import { makeTypeConstructor } from "../type_constructor.js";
import { constructSymbol } from "./symbol.js";
export const Type = { symbol: Symbol('Type'), params: [] };
export const Int = makeTypeConstructor(constructSymbol('Int'), 0);
export const Bool = makeTypeConstructor(constructSymbol('Bool'), 0);
export const Double = makeTypeConstructor(constructSymbol('Double'), 0);
export const Byte = makeTypeConstructor(constructSymbol('Byte'), 0);
export const Char = makeTypeConstructor(constructSymbol('Char'), 0);
// Unit type has only 1 instance, the empty tuple.
export const Unit = makeTypeConstructor(constructSymbol('Unit'), 0);
export const SymbolT = makeTypeConstructor(constructSymbol('Symbol'), 0);
export const Type = makeTypeConstructor(constructSymbol('Type'), 0);