November 2017
Intermediate to advanced
386 pages
9h 22m
English
Let's get ahead of ourselves. Doing FP doesn't mean always getting down to the very basic, simplest possible functions. For example, in the Converting to free point style section of Chapter 8, Connecting Functions - Pipelining and Composition, we will need a function to check if a number is negative, and we'll consider using binaryOp2() to write it:
const isNegative = curry(binaryOp2(">"))(0);
Never mind about the curry() function now (we'll get to it soon in Chapter 7, Transforming Functions - Currying and Partial Application) but the idea is that it fixes the first argument to zero, so our function will check, for a given number n, whether 0>n. The point here is that the function we just wrote isn't quite clear. ...