Is it possible to add piping ala |> to Erlang?

I stand corrected. In a very eloquent way, I might add.

FWIW, my aversion to the pipe would be much mitigated if it were observable. This would give it a tangible, as opposed to purely cosmetic, advantage over the nested function calls, without the need for “yucky code” (which is itself a tradeoff of immutability).

A contrived example based on the above, where I am arbitrarily choosing to say that the pipe operator on its own returns a list of the individual steps as it were an alias for [V1, V2, V3, V4, Vn]:

Eshell V12.1.3  (abort with ^G)
1> X |> atom_to_list
1>   |> list_to_binary
1>   |> capitalize_binary 
1>   |> binary_to_list
1>   |> binary_to_atom.
'ERLANG'
2> |>.
["Erlang", ..., ..., "ERLANG", 'ERLANG']

This is purely for illustrative purposes, so please don’t consider it a suggested syntax. I’d be very interested to learn if something akin to this is feasible in Elixir.

3 Likes