3 ms·
raku has had feed operators like this since its inception # pipeline functional style (1..5) ==> map { $_ * 2 } ==> grep { $_ > 5 } ==> say();
by librasteve 1y ago
raku has had feed operators like this since its inception
# pipeline functional style
(1..5)
==> map { $_ * 2 }
==> grep { $_ > 5 }
==> say(); # (6 8 10)
# method chain OO style
(1..5)
.map( * * 2)
.grep( * > 5)
.say; # (6 8 10)
uses ==> and <== for leftward
true it is syntax sugar, but often the pipe feed is quite useful to make chaining very obvious
https://docs.raku.org/language/operators#infix_==%3E https://docs.raku.org/language/operators#infix_==%3E