// words :: String -> [String] const words = str => split(' ', str);
Refactor to remove all arguments by partially applying the function.
const words = split(' ')
// filterQs :: [String] -> [String] const filterQs = xs => filter(x => x.match(/q/i), xs);
Refactor to remove all arguments by partially applying the functions.
As you can see, it is much more concise and sexy.
const filterQs = filter(match(/q/i));
Considering the following functions.
const keepHighest = (x, y) => (x >= y ? x : y); // max :: [Number] -> Number const max = xs => reduce((acc, x) => (x >= acc ? x : acc), -Infinity, xs);
max to not reference any arguments using the helper
const max = reduce(keepHighest, -Infinity);
An existing line!