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, for the numbers 1 to 50: square each in parallel, keep only the even squares, and print their sum.

Example

The program prints:

22100

Solution

See the solution

Course navigation

Solution: A hyper map   |   Solution: A racing sum