Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment