3 ms·
Yes, every function except the first one needs to have exactly one argument. Others have also said that `pipe` is not an ideal name for the function. So perhap
by upzylon 4y ago
Yes, every function except the first one needs to have exactly one argument.
Others have also said that `pipe` is not an ideal name for the function. So perhaps renaming it to `compose` and have `pipe` be of the form `pipe(arg, funA, funB, ...)` (like you suggested for `applyPipe`) might be the solution. Will need to think about it a bit more.
- anderskaseorg 4y agoNote ‘compose’ conventionally connotes a right-to-left order, so that (f ∘ g ∘ h)(x) = f(g(h(x))).