In Chapter 7, Transforming Functions - Currying and Partial Application, we saw several different ways to build new functions by applying higher-order functions. In this chapter, we will go to the core of FP and see how to create sequences of function calls, so their combination will produce a more complex result out of several simpler components. We will include the following:
- Pipelining, a way to join functions together in similar way to Unix/Linux pipes
- Chaining, which may be considered a variant of pipelining, but restricted to objects
- Composing, which is a classic operation with its origins in basic computer theory
Along the way, we will be touching on related concepts, such as the following:
- Pointfree style, which is often used with pipelining and composition
- Debugging of composed or piped functions, for which we'll whip up some auxiliary tools
- Testing of composed or piped functions, which won't prove to be of high complexity