7.4 Bags

Bags are finite multisets of values, i.e sets in which elements may occur multiply. Stated otherwise, a bag is a function from values to numbers, which maps each value to the number of its occurences in the bag. The type of a bag object is:

unit(put   :value-> 
     toList:->list
     member:value->bool)



Denys Duchier, Claire Gardent and Joachim Niehren
Version 1.3.99 (20050412)