Summary
During 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 idioms in the functional programming space - eithers and validation.
In the next chapter, we'll discuss the complement of functions - properties - which are used to retrieve and update values in objects.