Tags
#currying #functions #scala
Question

Curried functions are defined with multiple parameter lists, as follows:

def strcat(s1: String)(s2: String) = s1 + s2


Alternatively, you can also use the following syntax to define a curried function:

[...]
def strcat(s1: String) = (s2: String) => s1 + s2

Tags
#currying #functions #scala
Question

Curried functions are defined with multiple parameter lists, as follows:

def strcat(s1: String)(s2: String) = s1 + s2


Alternatively, you can also use the following syntax to define a curried function:

[...]
?

Tags
#currying #functions #scala
Question

Curried functions are defined with multiple parameter lists, as follows:

def strcat(s1: String)(s2: String) = s1 + s2


Alternatively, you can also use the following syntax to define a curried function:

[...]
def strcat(s1: String) = (s2: String) => s1 + s2
If you want to change selection, open original toplevel document below and click on "Move attachment"

#### Parent (intermediate) annotation

Open it
Curried functions are defined with multiple parameter lists, as follows: def strcat(s1: String)(s2: String) = s1 + s2 Alternatively, you can also use the following syntax to define a curried function: def strcat(s1: String) = (s2: String) => s1 + s2

#### Original toplevel document

Scala Currying Functions
esume WritingComputer GlossaryWho is Who Scala Currying Functions Advertisements Previous Page Next Page Currying transforms a function that takes multiple parameters into a chain of functions, each taking a single parameter. <span>Curried functions are defined with multiple parameter lists, as follows: def strcat(s1: String)(s2: String) = s1 + s2 Alternatively, you can also use the following syntax to define a curried function: def strcat(s1: String) = (s2: String) => s1 + s2 Following is the syntax to call a curried function: strcat("foo")("bar") You can define more than two parameters on a curried function based on your requirement. Let

#### Summary

status measured difficulty not learned 37% [default] 0

No repetitions