The nature of pipes

What about the other 15% of the time?

for these I would use x -> as before :slight_smile:
underscores also have a “15% ambiguity” for functions like map(_, x), filter(_, x)

and realistically, I think front/back pipes have a (small but nonzero) chance of eventual inclusion, underscores have near-zero, so part of it is just an attempt to be economical with my advocacy

1 Like

To clarify, I was referring to the effect of #24990 on piping, not its effect on creating small anonymous functions like 2_ or _ + 1. If I have to use x -> f(a, x, b) in order to write a pipe, then I just won’t write a pipe at all.

1 Like

Is there already a forward facing function composition operator?
So, one from left to right?

I have not seen one, and I would create an issue on Github, if there is none. :slight_smile: :ok_hand:t3:

Of possible operators, I personally probably prefer something available as a ligature, so among:


Most often for generic data manipulation you need anonymous functions, and that’s why there are single underscores in those examples: as in @p tbl |> map(_.field + 1).

For the common argument order and no anonymous functions, there’s no need for underscores: eg @p tbl |> map(sum) or @p 1:10 |> filter(isodd) |> map(exp).

1 Like

There is one in CompositionsBase.jl: . The package has hundreds of dependents, but pretty sure not because they use this operator – isn’t really used much.

I think that a valuable example, as this looks significantly more familiar.