refactor code: move everything from type_registry to "most appropriate" modules

This commit is contained in:
Joeri Exelmans 2025-03-20 18:12:30 +01:00
parent 4ca60784aa
commit 5283be608b
22 changed files with 160 additions and 164 deletions

View file

@ -1,6 +1,12 @@
import { fnType, lsType } from "../type_registry.js";
import { fnType } from "../metacircular.js";
import {Type, Function} from "../metacircular.js";
import {Int, Byte} from "../primitives/symbols.js";
import { DefaultMap } from "../util.js";
const listTypeRegistry = new DefaultMap(elementType => ({ listOf: elementType }));
// type constructor
export const lsType = elementType => listTypeRegistry.getdefault(elementType, true);
// 'normal' implementation
const emptyList = {l:[]};
@ -66,4 +72,4 @@ export const makeListModule = elementType => {
// {i: push , t: pushFnType},
]};
}
};
};