|
|
|
|
|
by sph
3 days ago
|
|
Elixir has it. To make it worthwhile, the entire standard library has to be designed to have the ‘object’ of the function as first argument. [1,2,3]
|> Enum.map(&square/1)
|> Enum.filter(&odd?/1)
Using a threading operator where there is no such consistency is painful. This is why I dislike CL’s or Python’s map function, taking the list to operate on as second argument, instead of first. A threading operator wouldn’t be as effective there. |
|