A comparison of atom libraries for Haskell, for example. simple atom and string atom

I need a string table in the Haskell program that I am developing. In particular, I want a system that allows you to put any String in (say) "Atom"; given Atom, you can restore the original string from which it came, and (critically) compare two atoms for equality should be as fast (or almost as fast) as comparing pointers.

(For this function, you can easily create a link-transparent interface, the implementation will be used unsafePerformIOinternally, but the library user should not know about these details.)

The two libraries available in Hackage seem to be in the right step: stringtable-atom and simple-atom. Does anyone have experience using these libraries? In particular, are there any suggestions as to what advantages one another can have?

+5
source share
2 answers

Another nice choice would be the ekmett new intern package, which handles bytestrings, as well as more complex recursive types: http://hackage.haskell.org/package/intern

He assured me that it is thread safe.

+2
source

monad-atom . , , , , , , .

0

All Articles