Course of Raku / Functional, concurrent, reactive, and web programming / Concurrent programming / Hyper and race 🆕 / Exercises / A hyper map
Solution: A hyper map
Here is a possible solution to the task.
Code
say (1..5).hyper.map(* * 3);🦋 You can find the source code in the file hyper-map.raku.
Output
(3 6 9 12 15)Comments
.hyperlets themaprun across threads.Because
.hyperpreserves order, the result is the same as an ordinarymap:(3 6 9 12 15).
Course navigation
← A hyper map | A racing sum →