4 ms·
> When did method chaining become 'functional programming'? It's very similar to applicative style in FP. Conceptually, method chaining is equivalent to nested
by jolux 1y ago
> When did method chaining become 'functional programming'?
It's very similar to applicative style in FP. Conceptually, method chaining is equivalent to nested function application, it just comes with syntax sugar for specifying the `self` parameter.
- Jaxan 1y agoA big difference is that it must include the thing the functions act upon (self). In functional programming you often leave that out. In FP you can also refactor little pieces of the chain into its own separate name (eg: smallest = sort >> head). This avoids long chains.
- fuzztester 1y agoInteresting. In which functional programming languages (that you know), can this be done? That refactoring little pieces, I mean. Looks like it would help with code readability.