my @in = ; my @out = gather { for @in -> $i { state $last; take $i if $i ne $last; $last = $i; }}; say @out;