In Pair§

See primary documentation in context for method antipair

method antipair(Pair:D: --> Pair:D)

Returns a new Pair object with key and value exchanged.

my $p = (=> 'Raku').antipair;
say $p.key;         # OUTPUT: «Raku␤» 
say $p.value;       # OUTPUT: «d␤»