Course of Raku / Functional, concurrent, reactive, and web programming / Functional programming / Data feeds / Exercises / Feed the big numbers

Solution: Feed the big numbers

Here is a possible solution to the task.

Code

(1..10) ==> grep(* > 5) ==> my @big;
say @big;

🦋 You can find the source code in the file feed-evens.raku.

Output

[6 7 8 9 10]

Comments

  1. The feed sends 1..10 into grep, which keeps the numbers greater than 5.

  2. The result flows into @big, the target that ends the feed.

Course navigation

Feed the big numbers   |   A feed pipeline