3 ms·
Raku also has map and grep methods for collections, so it could be written as... my @sink = @source.map({...}).grep({...}).sort; Which also makes multithrea
by tmtvl 4y ago
Raku also has map and grep methods for collections, so it could be written as...
my @sink = @source.map({...}).grep({...}).sort;
Which also makes multithreading the operation easy:
my @sink = @source.hyper.map({...}).grep({...}).sort.list;
That said, I think the operator you're looking for is the feed operator, ==>:
my @sink;
@source ==> map {...} ==> grep {...} ==> sort ==> @sink;
It also has the corresponding reverse, <==, because why not. The docs* mention that ==> may at some point do automatic parallelization, but I don't know what the status of that feature is.
* https://docs.raku.org/routine/==%3E https://docs.raku.org/routine/==%3E
- mst 4y ago> That said, I think the operator you're looking for is the feed operator, ==> Yes, yes it was. Your clarifications, corrections and elaborations are much appreciated.