Chapter 6. Currying Favors with Your Code

The word "curry" perks me up. The heavenly aromas wafting from the kitchen, the sheer magic worked out of legendary spices, and the right dash of salt—bliss! Life starts looking up again.

Scala, too, gives us constructs to liven up programming. We have used functions till now. However, in this chapter, we take a real good and close look at how easily we can pass around functions. We also look at some basic concepts such as lexical scopes and name binding. A discussion of local functions comes next. A discussion on closures comes after it. All these basics will help you to learn about two important techniques. The first is partially applied functions, with a nice detour into the intricacies of the underscore. ...

Get Scala Functional Programming Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.