refactor code: move everything from type_registry to "most appropriate" modules
This commit is contained in:
parent
4ca60784aa
commit
5283be608b
22 changed files with 160 additions and 164 deletions
|
|
@ -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},
|
||||
]};
|
||||
}
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue