basic functionality, no generics

This commit is contained in:
Joeri Exelmans 2025-03-14 16:56:37 +01:00
commit a8260f2afb
17 changed files with 615 additions and 0 deletions

15
function_registry.js Normal file
View file

@ -0,0 +1,15 @@
import { DefaultMap } from "./util.js";
const mapping = new DefaultMap(() => new Map());
export const getFnType = (inType, outType) => {
const m2 = mapping.getdefault(inType);
if (m2.has(outType)) {
return m2.get(outType);
}
else {
const fnType = {in: inType, out: outType};
m2.set(outType, fnType);
return fnType;
}
}