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
{{ message }}
This repository was archived by the owner on Jan 26, 2022. It is now read-only.
On the left, |> is as tight as assignment operators. This allows parsing x = y |> z as x = (y |> z), and x ? y : z |> w as (x ? y : z) |> w.
On the right, there are two options:
|> PipeExpression
|> AssignmentExpression
(2) matches the precedence of =>, which is the most similar operator to |> (they both take something on their left and put it in the expression on their right). It also allows thinks like x |> res = % and x |> () => %. However when used in longer chains, x |> y = % |> f(%) would be parsed as x |> (y = % |> f(%)) and not as x |> (y = %) |> f(%).
(1) disallows unparenthesized assignments and arrows on the right of |>.
On the left,
|>is as tight as assignment operators. This allows parsingx = y |> zasx = (y |> z), andx ? y : z |> was(x ? y : z) |> w.On the right, there are two options:
|> PipeExpression|> AssignmentExpression(2) matches the precedence of
=>, which is the most similar operator to|>(they both take something on their left and put it in the expression on their right). It also allows thinks likex |> res = %andx |> () => %. However when used in longer chains,x |> y = % |> f(%)would be parsed asx |> (y = % |> f(%))and not asx |> (y = %) |> f(%).(1) disallows unparenthesized assignments and arrows on the right of
|>.