O'Reilly logo

Functional Programming: A PragPub Anthology by Michael Swaine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5Creating Higher-Order Functions in Scala

by Venkat Subramaniam

In Chapter 3, Scala and Functional Style, we discussed higher-order functions in functional programming, and in Chapter 4, Working with Scala Collections, we looked at the higher-order functions in the Scala collections API. In this chapter, we’ll learn how to write our own higher-order functions.

Higher-order functions can accept other functions as parameters, can return functions, and can allow you to create functions within functions. In Scala, these functions that can be passed around are called function values.

You know that in OO programming, classes (or objects) abstract and encapsulate behavior and data. Well, function values also abstract and encapsulate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required