top | item 45323839

(no title)

jolux | 5 months 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.

discuss

order

Jaxan|5 months ago

A 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|5 months ago

Interesting. 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.