Currying in C#

A few days ago, I suddenly felt like experimenting with currying in C#. For those of you that don’t know what currying is, from Wikipedia currying: “[..] currying [..] is the technique of transforming a function that takes multiple arguments [..] in such a way that it can be called as a chain of functions each with a single argument.”

A simple example:

int Add(int x, int y) { return x + y; }
add3 = Add(3);

r1 = add3(6);
r2 = add3(9);

Continue reading “Currying in C#”