O'Reilly logo

Kotlin in Action by Svetlana Isakova, Dmitry Jemerov

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 8. Higher-order functions: lambdas as parameters and return values

This chapter covers

  • Function types
  • Higher-order functions and their use for structuring code
  • Inline functions
  • Non-local returns and labels
  • Anonymous functions

You were introduced to lambdas in chapter 5, where we explored the general concept and the standard library functions that use lambdas. Lambdas are a great tool for building abstractions, and of course their power isn’t restricted to collections and other classes in the standard library. In this chapter, you’ll learn how to create higher-order functions—your own functions that take lambdas as arguments or return them. You’ll see how higher-order functions can help simplify your code, remove code duplication, ...

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