Logo

Programming-Idioms

History of Idiom 37 > diff from v34 to v35

Edit summary for version 35 by Debaran:
[Scala] Fix type inference

Version 34

2019-02-02, 04:24:43

Version 35

2019-02-02, 04:25:36

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): Int = x + y
def add5(n: Int) = add(5, n)
Code
def add(x: Int, y: Int) = x + y
def add5(n: Int) = add(5, n)
Comments bubble
With only single parameter list
Comments bubble
With only single parameter list