Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added docs for method 'pairs' in Baggy. moritz++
  • Loading branch information
Jan-Olof Hendig committed Jun 20, 2016
1 parent ffb9ce7 commit 74757ad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/Type/Baggy.pod
Expand Up @@ -140,6 +140,20 @@ chosen elements from the invocant.
my $random_dishes := $breakfast.roll(*);
say $random_dishes[^5]; # (bacon eggs bacon bacon bacon)
=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)
=head2 method classify-list
=comment TODO
Expand Down

0 comments on commit 74757ad

Please sign in to comment.