Last active
June 20, 2016 19:11
-
-
Save dogbert17/efcb4849920629c281f0b8942b42fbf3 to your computer and use it in GitHub Desktop.
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