Pipelining
Pipelining and composition are techniques that are used to set up functions to work in sequence so that the output of a function becomes the input for the following function. There are two ways of looking at this: from a computer point of view, and from a mathematical point of view. We’ll look at both in this section. Most FP texts start with the latter, but since I assume that most of you will prefer computers over math, let’s start with the former instead.
Piping in Unix/Linux
In Unix/Linux, executing a command and passing its output as input to a second command, whose output will yield the input of a third command, and so on, is called a pipeline. This is quite a common application of the philosophy of Unix, as explained in a Bell Laboratories article written by the creator of the pipelining concept himself, Doug McIlroy:
- Make each program do one thing well. To do a new job, build afresh rather than complicating old programs by adding new features...