I was reading a blog post about combining higher order functions and it provided a C# example of "currying".
The examples look like:
public static Func<T1, Func<T2, T3>> Curry<T1, T2, T3>
(Func<T1, T2, T3> function)
{ return a => b => function(a, b); }
public static Func<T1, Func<T2, Func<T3, T4>>> Curry<T1, T2, T3, T4>
(Func<T1, T2, T3, T4> function)
{ return a => b => c => function(a, b, c); }
public static Func<T1, Func<T2, Func<T3, Func<T4, T5>>>> Curry<T1, T2, T3, T4, T5>
(Func<T1, T2, T3, T4, T5> function)
{ return a => b => c => d => function(a, b, c, d); }
My question is, can methods taking other forms that effectively produce the same "curried form" result be considered currying.
For example, are the following methods considered currying? If not, what is the more appropriate naming convention?
public static Func<T1, Func<T2, Func<T3, Func<T4, T5>>>> SomethingLikeCurry<T1, T2, T3, T4, T5>
(Func<T1, T2, Func<T3, T4, T5>> function)
{ return a => b => c => d => function(a, b)(c, d); }
public static Func<T1, Func<T2, Func<T3, T4>>> SomethingLikeCurry<T1, T2, T3, T4>
(Func<T1, T2, Func<T3, T4>> function)
{ return a => b => c => function(a, b)(c); }