fix some things
This commit is contained in:
parent
d9111c3969
commit
bbac7858ae
16 changed files with 69 additions and 55 deletions
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue