Common set operations
Opened this issue · 2 comments
Is it possible to write efficient implementations for common set operations like intersection, difference, etc.? I can certainly model them with lookup
but I wonder if there is a more efficient implementation.
I have no doubt that it's possible to implement more efficient dedicated functions, but you'll need to operate on the internal HAMT abstraction level. IOW, in a manner of a pull request. Otherwise current API provides no better method than lookup.
BTW, not that long ago I've extracted the internal HAMT abstraction into a separate library: https://github.com/nikita-volkov/stm-hamt. However I haven't released an updated version of "stm-containers" based on it, since there was a small ununderstandable performance degradation, which I got stuck trying to resolve. Any way, it might be useful for further research.