Issue #15799 has been updated by jeremyevans0 (Jeremy Evans).


I think a pipeline operator can be helpful in a functional language, based on my experience with `$` in Haskell.   However, I don't think it is a good idea to implement a replacement for the `.` operator just to avoid parentheses.  If it has different semantics, maybe it could be useful, but it would depend on what those semantics are.  Because Ruby uses methods instead of functions, I'm not sure what semantics we would want from a pipeline operator.

----------------------------------------
Feature #15799: pipeline operator
https://bugs.ruby-lang.org/issues/15799#change-78217

* Author: nobu (Nobuyoshi Nakada)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Implemented the pipeline operator `|>`, a topic of "ruby committers vs the world" in RubyKaigi 2019.
Also a casual idea of rightward assignment.

```ruby
1.. |> take 10 |> map {|x| x*2} |> (x)
p x #=> [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
```

https://github.com/nobu/ruby/tree/feature/pipeline




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>