Currying

This converts a function with multiple input parameter to a function which takes one parameter at a time, or we can say it breaks the function into multiple functions, each taking one parameter at a time. Here is an example:

int sum = (a,b) => a+bint sumcurry = (a) =>(b) => a+bsumcurry(5)(6) // 11int sum8 = sumcurry(8) // b=> 8+bsum8(5) // 13

Get .NET Core 2.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.