Skip to content

Commit ade1fc8

Browse files
authored
Merge pull request #79 from scala-exercises/function-types
Generalize the syntax of function types
2 parents 26a9a45 + e3eebe0 commit ade1fc8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/scala/scalatutorial/sections/HigherOrderFunctions.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ object HigherOrderFunctions extends ScalaTutorialSection {
8080
*
8181
* So, `Int => Int` is the type of functions that map integers to integers.
8282
*
83+
* Similarly, `(A1, A2) => B` is the type of functions that take two arguments
84+
* (of types `A1` and `A2`, respectively) and return a result of type `B`.
85+
*
86+
* More generally, `(A1, ..., An) => B` is the type of functions that take `n`
87+
* arguments (of types `A1` to An`) and return a result of type `B`.
88+
*
8389
* = Anonymous Functions =
8490
*
8591
* Passing functions as parameters leads to the creation of many small functions.

0 commit comments

Comments
 (0)