September 2015
Intermediate to advanced
250 pages
6h 40m
English
Functions are first-class citizens in functional programming. You can pass functions to functions as parameters, return them from functions, and even nest functions within functions. These higher-order functions are called function values in Scala. Closures are special forms of function values that close over or bind to variables defined in another scope or context.
In addition to object decomposition, you can structure applications around function values as building blocks, since Scala supports both the OO and functional styles of programming. This can lead to concise, reusable code. In this chapter, you’ll learn to use function values and closures in Scala.
Read now
Unlock full access