This file contains 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
let add2 = (+) 2 | |
let add3 = (+) 3 | |
let add5 = add2 >> add3 | |
let add10 = ((+) 3) >> ((+) 7) |
This file contains 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
Func<int,int> add2 = val => val + 2; | |
Func<int,int> add3 = val => val + 3; | |
Func<Func<int, int>, Func<int, int>> compose(Func<int, int> f) => g => val => g(f(val)); | |
Func<int, int> add5 = compose(add2)(add3); | |
Func<int, int> add10 = compose(a => a + 3)(a => a + 7); |