ANNOUNCE: multiset 0.1

Twan van Laarhoven twanvl at gmail.com
Thu Feb 7 12:20:12 EST 2008


(moving discussion to the libraries list)

Wolfgang Jeltsch wrote:
> this is interesting.  A few days ago I discovered that I needed such a library 
> and decided to implement it myself.  However, I had not started yet when I 
> received your e-mail.
> 
> A bit of criticism concerning the name: According to the English Wikipedia, 
> multiset is a single word.  So the identifiers should be Multiset and 
> IntMultiset instead of MultiSet and IntMultiSet.

After looking around a bit, it seems 'multiset' is consistently spelled as a 
single word. Personally I think "MultiSet" looks better, but if more people 
agree with you I will change the name in the next version.

> However, I think it would 
> be even better to just use Bag and IntBag as identifiers.  Those are shorter 
> and maybe easier to remember.  After all, the term bag is fairly standard.

There are two several for choosing "multiset" over "bag":

   - The name "multiset" covers the functionality much better. If I didn't know 
the name of the data structure, only that it is like a set containing multiple 
copies of elements, I would find it if it was called multiset, not if it was 
called bag.

   - The name Bag is also used for other data structures. For instance GHC uses 
'bag' for an ordered data structure with fast concatenation.

   - Other libraries like the C++ STL also use the name multiset.

> I think that actually your multiset/bag implementation should be a part of the 
> containers package.  So why not ask the maintainers of the containers package 
> for permission to add your implementation and change the identifiers to Bag 
> and IntBag during this process?  This would be great.

I initially wrote these modules as part of the containers package. Unfortunatly 
the libraries process is awefully slow. And if you think about it, there isn't a 
big advantage to having multiset in the containers package. I decided to get the 
code out there quickly, so it can be used right now.

Perhaps the library could/should be merged into the containers package somewhere 
in the future.

Twan


More information about the Libraries mailing list