Lambda Expressions
In this lesson, we introduce lambda expressions and show how to use them in conjunction with higher-order functions.
We'll cover the following...
In the previous lesson, we defined the higher-order function applyTwice and then used it on other functions like next or double.
It can be annoying to define simple functions like double or next, especially if we just want to use them once in a higher-order function call.
If we just want to use a simple function temporarily, we do not need to give it a name. Instead, we can create an anonymous function using a lambda expression.
Introduction to lambda expressions
Lambda expressions are named after a mathematical system called Lambda calculus, which is the theoretical foundation of functional programming languages like Haskell. Lambda expressions start with the \ character, because it looks a little like the Greek letter lambda, requiring some imagination.
For ...