In this chapter, we discussed more advanced use cases of functions, especially higher-order functions that underpin the collections library in most modern languages—Kotlin being no exception. We saw how the many features Kotlin provides around functions can be leveraged to write custom DSLs. Finally, we introduced common expressions in the functional programming space—eithers and validation.
In Chapter 6, Properties, we'll discuss the complement of functions—properties—which are used to retrieve and update values in objects.