Last active
June 20, 2016 19:11
Star
You must be signed in to star a gist
Attempt to document Baggy.pairs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =head2 method pairs | |
| Defined as: | |
| method pairs(Baggy:D:) returns Seq:D | |
| Returns all elements and their respective weights as a L<Seq|/type/Seq> of C<Pair>s | |
| where the key is the element itself and the value is the weight of that element. | |
| my $breakfast = bag <bacon eggs bacon>; | |
| my $seq = $breakfast.pairs; | |
| say $seq.sort; # (bacon => 2 eggs => 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment