get rid of some stuff

This commit is contained in:
Joeri Exelmans 2025-05-23 14:45:35 +02:00
parent 2333abe70f
commit 3d72f4d416
6 changed files with 38 additions and 86 deletions

View file

@ -1,5 +1,5 @@
import { inspect } from "node:util";
import { assignFn } from "../generics/generics.js";
// import { assignFn } from "../generics/generics.js";
function inspectDynamic(_depth, options, inspect) {
return `${inspect(this.i, options)} :: ${inspect(this.t, options)}`;
@ -13,14 +13,14 @@ export const newDynamic = i => t => ({
export const getInst = lnk => lnk.i;
export const getType = lnk => lnk.t;
export const apply = input => fun => {
const inputType = getType(input)
const funType = getType(fun);
const outputType = assignFn(funType, inputType);
// export const apply = input => fun => {
// const inputType = getType(input)
// const funType = getType(fun);
// const outputType = assignFn(funType, inputType);
const inputValue = getInst(input);
const funValue = getInst(fun);
const outputValue = funValue(inputValue);
// const inputValue = getInst(input);
// const funValue = getInst(fun);
// const outputValue = funValue(inputValue);
return newDynamic(outputValue)(outputType);
};
// return newDynamic(outputValue)(outputType);
// };

View file

@ -1,5 +1,5 @@
import { getDefaultTypeParser } from "../parser/type_parser.js";
import { apply, getInst, getType, newDynamic } from "./dynamic.js";
import { getInst, getType, newDynamic } from "./dynamic.js";
const mkType = getDefaultTypeParser();
@ -9,5 +9,4 @@ export const ModuleDynamic = [
["newDynamic", newDynamic(newDynamic)(mkType("a -> Type -> Dynamic" ))],
["getInst" , newDynamic(getInst )(mkType("Dynamic -> a" ))],
["getType" , newDynamic(getType )(mkType("Dynamic -> Type" ))],
["apply" , newDynamic(apply )(mkType("Dynamic -> Dynamic -> Dynamic"))],
];