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 ffb9ce7 commit 74757adCopy full SHA for 74757ad
doc/Type/Baggy.pod
@@ -140,6 +140,20 @@ chosen elements from the invocant.
140
my $random_dishes := $breakfast.roll(*);
141
say $random_dishes[^5]; # (bacon eggs bacon bacon bacon)
142
143
+=head2 method pairs
144
+
145
+Defined as:
146
147
+ method pairs(Baggy:D:) returns Seq:D
148
149
+Returns all elements and their respective weights as a L<Seq|/type/Seq> of C<Pair>s
150
+where the key is the element itself and the value is the weight of that element.
151
152
+ my $breakfast = bag <bacon eggs bacon>;
153
+ my $seq = $breakfast.pairs;
154
+ say $seq.sort; # (bacon => 2 eggs => 1)
155
156
157
=head2 method classify-list
158
159
=comment TODO
0 commit comments