Logo

Programming-Idioms

History of Idiom 37 > diff from v6 to v7

Edit summary for version 7 by :

Version 6

2015-08-23, 11:05:52

Version 7

2015-09-03, 16:34:18

Idiom #37 Currying

Technique of transforming a function that takes multiple arguments and returning a function for which some of the arguments are preset.

Idiom #37 Currying

Technique of transforming a function that takes multiple arguments and returning a function for which some of the arguments are preset.

Code
adder = -> a, b { a + b }
add_two = adder.curry.(2)
add_two.(5) # => 7