Persistent Bags / Multisets

Here's an implementation of a persistent bag/multiset, using a pmap to count elements.

This is pretty similar to collections.Counter in the Python stdlib, but less leaky :)

If you think it's not appropriate for pyrsistent, that's fine, I can release it as a separate library.

Since the PBag class is private (as are PMap, PVector etc) I decided to prefix it with an underscore.

This is very nice and concise code. For large collections of elements I think that there are some opportunities for optimizations here by creating a regular mutable dictionary here and, as a last step, making a pmap out of it. Not saying that we have to do it now though.