In this chapter, we've discussed using functions as first-class citizens. We've seen how function types are used. We have seen how to define function literals (anonymous functions and lambda expressions), and that any function can be used as an object thanks to function references. We've also discussed higher-order functions and the different Kotlin features that support them: the implicit name of a single parameter, the last lambda in an argument convention, Java SAM support, using an underscore for unused variables, and destructuring declarations in lambda expressions. These features provide great support for higher-order functions, and they make functions even more than first-class citizens.
In the next chapter, we are going to see how generics work in Kotlin. This will allow us to define much more powerful classes and functions. We will also see how well they can be used when connected to higher-order functions.