Introduction
Despite the fact that Kotlin is recognized implicitly as an object-oriented language, it is still open to other programming styles and paradigms. Thanks to Kotlin's built-in features, we are able to apply functional programming patterns to our code with ease. Having the possibility to return functions from other functions or to pass a function as a parameter allows us to benefit from a deferred computation. In addition, we are able to return functions, instead of already-computed values, on different layers in the code. This results in the lazy-evaluation feature.
Compared to Scala or other functional programming languages, Kotlin doesn't require us to use dedicated, functional style design patterns. It also lacks some of their out-of-the-box implementations. However, in return, it brings more flexibility to developers as far as software architecture and implementation details are concerned. The Kotlin language and standard library components provide full built-in support for...