Course of Raku / Functional, concurrent, reactive, and web programming / Concurrent programming / Hyper and race 🆕 / Exercises / Hyper with a filter
Solution: Hyper with a filter
Here is a possible solution to the task.
Code
say (1..10).hyper.grep(* > 5);🦋 You can find the source code in the file hyper-filter.raku.
Output
(6 7 8 9 10)Comments
.hyperparallelises thegrepwhile preserving order.Only the numbers greater than
5are kept, giving(6 7 8 9 10).