role QuantHash

Common role for collections of objects represented as hash keys

class QuantHash does Associative { }

A QuantHash represents a set of objects, represented as the keys of a Hash. When asked to behave as a list it ignores its .values and returns only .keys (possibly replicated by weight in the case of bag types). For any QuantHash, the .total methods returns the current sum of the values.

All standard QuantHash containers have a default value that is false (such as 0 or '' or Nil or Bool::False), and keep around only those entries with non-default values, automatically deleting any entry if its value goes to that (false) default value.

Type graph

Below you should see a clickable image showing the type relations for QuantHash that links to the documentation pages for the related types. If not, try the PNG version instead.

perl6-type-graph QuantHash QuantHash Associative Associative QuantHash->Associative Setty Setty Setty->QuantHash Baggy Baggy Baggy->QuantHash Mu Mu Any Any Any->Mu Set Set Set->Setty Set->Any SetHash SetHash SetHash->Setty SetHash->Any Mixy Mixy Mixy->Baggy BagHash BagHash BagHash->Baggy BagHash->Any Bag Bag Bag->Baggy Bag->Any MixHash MixHash MixHash->Any MixHash->Mixy Mix Mix Mix->Any Mix->Mixy