Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



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:

[...]
Answer
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:

[...]
Answer
?

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:

[...]
Answer
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

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.