January 2020
Intermediate to advanced
470 pages
11h 13m
English
You can easily recognize a pointfree function definition because it doesn't need the function keyword or the => symbol. Let's revisit some of the previous functions we wrote in this chapter and check them out. For example, the definition of our original file-counting functions is as follows:
const countOdtFiles3 = path => pipeTwo(pipeTwo(getDir, filterOdt), count)(path);const countOdtFiles4 = path => pipeTwo(getDir, pipeTwo(filterOdt, count))(path);
The preceding code could be rewritten as follows:
const countOdtFiles3b = pipeTwo(pipeTwo(getDir, filterOdt), count);const countOdtFiles4b = pipeTwo(getDir, pipeTwo(filterOdt, count));
The new definitions don't make reference to the parameter for the newly defined ...