Course of Raku / Functional, concurrent, reactive, and web programming / Concurrent programming / Hyper and race 🆕 / Exercises

A racing sum

Problem

Summing does not care about order, so .race — the unordered partner of .hyper — is the right tool. Using .race, double each of the numbers 1 to 50 in parallel, then sum the results. Print the total.

Example

The program prints:

2550

Solution

See the solution

Course navigation

Solution: A hyper map   |   Solution: A racing sum