What is the advantage of Currying in C#? (achieving partial function)

c#, currying

Solution

The advantage of Currying in C# is that it allows C# developers to develop in a Functional Programming style.

Think about LINQ. A LINQ query allows you to pass in a method as a parameter:

someCollection.Where(x => x.someVal == 1);

`x.someVal == 1` gets evaluated as a function and then `Where` uses the return value in its own execution.

It's an example that most .NET 3 developers are familiar with, but few realize that they're dabbling in Function Programming. Without the ability to Curry, LINQ wouldn't be possible.

...hopefull that makes up for my smart-ass comment.

Problem

What is the advantage of Currying in C#? What is the advantage of achieving partial function application on a curried function?

Original source