In role Setty§

See primary documentation in context for method new-from-pairs

method new-from-pairs(*@pairs --> Setty:D)

Constructs a Setty object from a list of Pair objects given as positional arguments:

say Set.new-from-pairs: 'butter' => 0.22'salt' => 0'sugar' => 0.02;
# OUTPUT: «Set(butter sugar)␤»

Note: be sure you aren't accidentally passing the Pairs as positional arguments; the quotes around the keys in the above example are significant.

In role Baggy§

See primary documentation in context for method new-from-pairs

method new-from-pairs(Baggy: *@pairs --> Baggy:D)

Constructs a Baggy objects from a list of Pair objects given as positional arguments:

say Mix.new-from-pairs: 'butter' => 0.22'sugar' => 0.1'sugar' => 0.02;
# OUTPUT: «Mix(butter(0.22) sugar(0.12))␤»

Note: be sure you aren't accidentally passing the Pairs as positional arguments; the quotes around the keys in the above example are significant.