Let\'s say I want all permutations of 2 letters out of a, b and c.
I can do:
my @perm = .combinations(2)».permutations;
say @perm;
# [((
By inserting slips as appropriate, eg via
.combinations(2).map(*.permutations.Slip).Array
or
[ slip .permutations for .combinations(2) ]
Invoking .Array in the first example is unnecessary if you're fine with a Seq, and can be replaced with calls to .list or .cache (supplied by PositionalBindFailover) if mutability is not needed.
In the second example, the prefix | operator could be used instead of the slip sub.