fix some things

This commit is contained in:
Joeri Exelmans 2025-05-08 21:30:56 +02:00
parent d9111c3969
commit bbac7858ae
16 changed files with 69 additions and 55 deletions

View file

@ -1,3 +1,17 @@
import { assignFn } from "../generics/generics.js";
export const newDynamic = i => t => ({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);
const inputValue = getInst(input);
const funValue = getInst(fun);
const outputValue = funValue(inputValue);
return newDynamic(outputValue, outputType);
};