Skip to content

Commit 8fc7432

Browse files
committed
Clarify Setty/Baggy and add examples
1 parent 9e67b06 commit 8fc7432

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

doc/Type/QuantHash.pod6

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,24 @@ typically L<Mu>.
4949
method Setty(--> Setty:D)
5050
5151
Coerce the C<QuantHash> object to the equivalent object that uses the L<Setty>
52-
role.
52+
role. Note that for L<Mixy> type coercion items with negative values will be skipped.
53+
54+
my %b is Bag = one => 1, two => 2;
55+
say %b.Setty; # OUTPUT: «set(one two)␤»
56+
my %m is Mix = one => 1, minus => -1;
57+
say %m.Setty; # OUTPUT: «set(one)␤»
5358
5459
=head2 method Baggy
5560
5661
method Baggy(--> Baggy:D)
5762
5863
Coerce the C<QuantHash> object to the equivalent object that uses the L<Baggy>
59-
role.
64+
role. Note that for L<Mixy> type coercion items with negative values will be skipped.
65+
66+
my %s is Set = <one two>;
67+
say %s.Baggy; # OUTPUT: «Bag(one, two)␤»
68+
my %m is Mix = one => 1, minus => -1;
69+
say %m.Baggy; # OUTPUT: «Bag(one)␤»
6070
6171
=head2 method Mixy
6272
@@ -65,6 +75,11 @@ role.
6575
Coerce the C<QuantHash> object to the equivalent object that uses the L<Mixy>
6676
role.
6777
78+
my %s is Set = <one two>;
79+
say %s.Mixy; # OUTPUT: «Mix(one, two)␤»
80+
my %b is Bag = one => 1, two => 2;
81+
say %b.Mixy; # OUTPUT: «Mix(one, two)␤»
82+
6883
=end pod
6984

7085
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)