nikita-volkov / stm-containers

Containers for STM
http://hackage.haskell.org/package/stm-containers
MIT License
66 stars 13 forks source link

Common set operations #15

Open 3noch opened 7 years ago

3noch commented 7 years ago

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.

nikita-volkov commented 7 years ago

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.

nikita-volkov commented 7 years ago

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.