In the previous chapter, we saw how Kotlin features relate to OOP. This chapter will introduce advanced functional programming features that were previously not present in standard Android development. Some of them were introduced in Java 8 (in Android through the Retrolambda plugin), but Kotlin introduces many more functional programming features.
This chapter is about high-level functions and functions as first-class citizens. Most of the concepts are going to be familiar to readers who have used functional languages in the past.
In this chapter, we will cover the following topics:
- Function types
- Anonymous functions
- Lambda expressions
- The implicit name of a single parameter in a lambda expression
- Higher-order functions
- The last lambda in an argument convention
- The Java Single Abstract Method (SAM) lambda interface
- Using Java methods with Java...