You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Elixir style
run("hello") |> withThis(10) |> andThis(20)
// is equivalent to
andThis( withThis( run("hello"), 10 ), 20 )
👎 Gives a new semantic meaning to what looks like a normal function call. For example, withThis(10) is no longer just calling that function with one argument
👎 Putting the left-hand side as the first argument to the right-hand side is pretty arbitrary.
With reverse pipline (and additional feature of applying arguments from the right) it could be written as
run("hello") |> withThis <| 10 |> andThis <| 20
When both operators are used in an expression like this, the resverse pipe accepting arguments from the right would apply them _after_ the arguments coming from the regular pipeline from the left.
Regular pipeline takes higher precedence than reverse pipeline.
This is regular:
How about reverse pipeline with a new operator:
<|
There were previous talks about Elixir-like syntax
With reverse pipline (and additional feature of applying arguments from the right) it could be written as
When both operators are used in an expression like this, the resverse pipe accepting arguments from the right would apply them _after_ the arguments coming from the regular pipeline from the left.
Regular pipeline takes higher precedence than reverse pipeline.
Thoughts?
The text was updated successfully, but these errors were encountered: