@@ -700,12 +700,11 @@ function. Use a map or some such for that.
700
700
=item invert
701
701
702
702
multi method invert ( --> List ) is export {
703
- self.map: -> $p { $.value X=> $.key }
703
+ self.map: -> $p { $.value »=>» $.key }
704
704
}
705
705
706
706
Produces a backmapping of values to keys, expanding list values
707
- into multiple pairs. (The C<< X=> >> expands C<$v> if it is a list.)
708
- To handle keys that do C<Positional> you'll need to write your own map.
707
+ into multiple pairs. (The C<< »=>» >> expands the value if it is a list.)
709
708
710
709
The invocant must be a list containing only Pairs, and throws an error if
711
710
anything that is not a Pair is passed. To get combine kv values, use
@@ -1040,12 +1039,14 @@ the keys in the hash matches.
1040
1039
=item invert
1041
1040
1042
1041
multi method invert ( %hash: --> List ) is export {
1043
- map -> $k, $v { $v X=> $k }, %hash.kv;
1042
+ map -> $k, $v { $v »=>» $k }, %hash.kv;
1044
1043
}
1045
1044
1046
1045
Produces a backmapping of values to keys, expanding list values
1047
- into multiple pairs. (The C<< X=> >> expands C<$v> if it is a list.)
1048
- To handle keys that do C<Positional> you'll need to write your own map.
1046
+ into multiple pairs. (The C<< »=>» >> expands C<$v> if it is a list.)
1047
+
1048
+ This function is essentially a shortcut for C<.pairs.invert>, but bypasses
1049
+ the creation of pairs only to invert them.
1049
1050
1050
1051
=item push
1051
1052
0 commit comments