John Mount has thoughts on the upcoming pipe operator in R:
There is a current active discussion on this prototype and some interesting points come up. Note the current proposal appears to disallow
a |> f -> f(a), a currently popular transform.
1. This is a language feature presented as a soon-to-be-user-visible prototype, not an RFC.
2. Some are objecting to the term “pipe.”
3. Some call this sort of pipe function composition.
4. It is noticed that this sort of substitution is generally thought of as a “macro.”
5. There is a claim the proposed pipe seems to violate the beta-reduction rule of the lambda calculus: variables should be substitutable for values.
Read on for John’s take on this. I particularly appreciate his response to point number 2: other functional languages have pipes (in fact,
|> is the F# pipe operator). Pipes are not unique to UNIX. John has a lot of interesting comments, so check them out.