i am trying to learn F# functional programming but i have some issues translating some concepts from Javascript functional programming to F#. I have this code that enables me to compose a "pipeline" of functions in Javascript like this:
const compose = ((functions) => {
return ((input) => {
return functions.reduce((ack, func) => {
return func(ack);
}, input);
});
});
const addOne = ((input) => input + 1);
const addTwo = ((input) => input + 2);
const composedFunction = compose([addOne, addTwo]);
const result = composedFunction(2);
console.log(result);
Is it even possible to do this kind of composition in F#? How would i do it?