Fundamentals of functional programming
Functional programming consists of few new concepts such as lambdas, pure functions, high-order functions, function types, and inline functions, which we will be learning. Quite interesting, isn't it?
Note
Note that, although in many programmers word, pure functions and lambdas are the same, they are actually not. In the following part of this chapter, we will learn more about them.
Lambda expressions
Lambda or lambda expressions generally mean anonymous functions, that is, functions without names. You can also say a lambda expression is a function, but not every function is a lambda expression. Not every programming language provides support for lambda expressions, for instance, Java didn't have it until Java 8. The implementations of lambda expressions are also different in respect to languages. Kotlin has good support for lambda expressions and implementing them in Kotlin is quite easy and natural. Let's now take a look at how lambda expressions work...