Feature request: pipelining operator
Like the pipe operator, but works on elements of collections. Accepts local free functions, proc objects and blocks. Also accepts methods of the items.
fn(value) -> value + 1
puts [1,2,3] |>> fn |>> fn -- outputs [3,4,5]
puts [1,2,3] |>> .to_s -- calls a method on each object, outputs ["1", "2", "3"]
Essentially sugar for map. But nice sugar.
We could also have ?> for select, !> for reject, and so on.
These are very specific sugars for very specific narrow-use methods.
I went down the road of zillions of operators in Jytron, about two-three years ago, and finally concluded that they sometimes took more screen estate, while still making code less clear. Haskell fails in this regard to, as far as I am concerned.
It does give important food for thought in any event! Some ideas about more general construct for accomplishing above in a terse way starts bubbling in my head. I'll get back to this.
Hm. I really like this sugar though :(
This has parallels to #89 also.