my @arr = (0,0,1, 3,2,0, 1,1,1); my @output = gather { for @arr -> $a, $b, $c { take $a + $b + $c; } }