In this section, we'll introduce the concept of wrapping values. Then we'll use the wrapper to chain function calls. We'll also look at how call chains are terminated.
Chaining function calls together is a pattern of applicative programming, where a collection is transformed into something different. This newly transformed collection is then passed to the next call in the chain, and so on. This is where the term applicative comes from; you're applying functions to every item in a collection. Since this process is repeated over and over, it's easy to package chained calls into a reusable component. It's a pipeline that's adding, removing, or modifying values along each step of the way, producing a result at the end.
Another way, perhaps, is a more practical view of chains, which is just a simpler way to make function calls. jQuery popularized this notion. When reading jQuery code, you'll find that there are a lot of chained calls, and yet the code is readable...