Higher-Order Functions
In this chapter, we are going to explore the concept of function composition through higher-order functions. There are a variety of new concepts that we are introducing here, such as closures, partial application, and function currying. We will take a look at some practical examples and real-world use cases for these.
First, we will cover the core concepts of composing functions from an abstract viewpoint, and then we will combine the concepts in a practical example. Everything that we will learn here leans heavily on the concepts introduced in Chapter 2, where we learned what it means to treat functions as first-class citizens.
In this chapter, we will cover the following:
- An introduction to higher-order functions
- Closures and variable scoping
- Partial application
- Function currying, or how to reduce n-ary functions to unary functions
- Examples: