We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5629275 commit 7faaaf9Copy full SHA for 7faaaf9
doc/Type/Map.pod6
@@ -173,6 +173,21 @@ Returns a C<Seq> of keys and values interleaved.
173
174
Map.new('a', 1, 'b', 2).kv # (a 1 b 2)
175
176
+=head2 method sort
177
+
178
+Defined as:
179
180
+ multi method kv(Map:D: --> Seq:D)
181
182
+Returns a L<Seq> of L<Pair> objects, which are the pairs of the hash,
183
+sorted by key. Equivalent to C<%hash.sort: *.key>
184
185
+ # These are equivalent:
186
+ say Map.new(<c 3 a 1 b 2>).sort; # OUTPUT: «(a => 1 b => 2 c => 3)»
187
+ say Map.new(<c 3 a 1 b 2>).sort: *.key; # OUTPUT: «(a => 1 b => 2 c => 3)»
188
189
+See L<Any.sort|/type/Any#method_sort> for additional available candidates.
190
191
=head2 method Int
192
193
Defined as:
0 commit comments