Logo

Programming-Idioms

History of Idiom 37 > diff from v35 to v36

Edit summary for version 36 by Debaran:
New Scala implementation by user [Debaran]

Version 35

2019-02-02, 04:25:36

Version 36

2019-02-02, 04:27:49

Idiom #37 Currying

Transform a function that takes multiple arguments into a function for which some of the arguments are preset.

Idiom #37 Currying

Transform a function that takes multiple arguments into a function for which some of the arguments are preset.

Extra Keywords
curry
Extra Keywords
curry
Code
def add(x: Int)(y: Int) = x + y
def add5 = add(5)_
Comments bubble
With multiple parameter lists. (add5 takes the 1 parameter of the other parameter list)