@neauoire Only just came across this stuff you're doing recently and it looks fascinating. I wonder how you implement bags in the background. Since you use the / operator to remove or replace things I was wondering if perhaps each bag is a bignum with entities inside the sets (sorry, bags) represented by distinct prime numbers, and the bag as a whole being the product of all members...

It's an idea I toyed with a long time ago (for a different application) and I'd be delighted to find out that someone else might be using the same thing.

Again, it's all just about seeing the / sign and jumping to (probably unwarranted) conclusions.