Created
March 19, 2017 11:38
-
-
Save xaviervia/17f533ada9bb8a2f0ca9ba0b066ff85c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const computationGraph = ComputationGraph([ | |
x => x + 1, | |
[ | |
x => x * 2, | |
x => x / 2 | |
], | |
[ | |
x => x + 10 | |
] | |
]) | |
const resultGraph = generateVoidResult(computationGraph) | |
/* | |
[ | |
Right.of([undefined, undefined]), | |
[ | |
Right.of([undefined, undefined]), | |
Right.of([undefined, undefined]) | |
], | |
[ | |
Right.of([undefined, undefined]) | |
] | |
] | |
*/ | |
const recomputeGraph = injectValueInRoot(resultGraph)(3) | |
/* | |
[ | |
Right.of([3, undefined]), | |
[ | |
Right.of([undefined, undefined]), | |
Right.of([undefined, undefined]) | |
], | |
[ | |
Right.of([undefined, undefined]) | |
] | |
] | |
*/ | |
const newResult = computationGraph(recomputeGraph) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment