- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.7k
 
Description
R's magrittr has the tee pipe %T>%. The difference with the normal pipe %>% is that an expression like a %T>% b returns a, not b. This can be super useful in data processing pipelines a la dplyr (and what I'm currently building out with the standalone operators in Query.jl).
It would be great if julia could at some point get something like that as well. One option would be |>>. It would kind of signal that the stuff on the left hand side is going to be moved one more over in a pipe, i.e. something like a |>> b |> c to me looks fairly reasonable in that it signals that the return value of a would "jump" over b. But I'm sure there are other ideas as well, so I'm not super wedded to this specific syntax.
It is not clear to me whether something like |>> could be introduced in julia 1.x, or whether that would be breaking. When I do a |>>b I get an error ERROR: syntax: ">" is not a unary operator. I think that means one could define |>> in a julia 1.x without breaking anything, but is that right?
If that is correct, great. But if not, i.e. if this would be breaking, is there a chance that we could make some syntax illegal for julia 1.0, with the plan to later enable this kind of tee pipe in some 1.x version?