Functions as classes

The fact that functions are classes means that they can be freely passed to other methods or classes as if they were just values. This leads to improving the expressiveness of Scala and making it much easier to achieve things, such as callbacks, than in other languages such as Java.

Get Scala Design Patterns - Second Edition 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.