What symbol / atom/ interned-string package is currently preferred?

Hi cafe, I use symbols all the time when manipulating code. I vacillate between using stringtable-atom, symbol, and simple-atom. Unfortunately: - Stringtable-atom is has a broken build right now (GHC 7.6). (Also I've had some crashes with it in the past.) - simple-atom has dependency upper bounds that restrict it to GHC <= 7.0 - "symbol" has a design flaw, which is that it exposes the constructor for Symbol, which reveals the (nondeterministic) unique Int IDs. I.e. it is not "SafeHaskell". I submitted a pull request to relax simple-atom, but perhaps there are other packages people use with which I am not aware? Thanks, -Ryan

On Tue, May 7, 2013 at 2:58 PM, Ryan Newton
Hi cafe,
I use symbols all the time when manipulating code. I vacillate between using stringtable-atom, symbol, and simple-atom. Unfortunately:
Stringtable-atom is has a broken build right now (GHC 7.6). (Also I've had some crashes with it in the past.) simple-atom has dependency upper bounds that restrict it to GHC <= 7.0 "symbol" has a design flaw, which is that it exposes the constructor for Symbol, which reveals the (nondeterministic) unique Int IDs. I.e. it is not "SafeHaskell".
I submitted a pull request to relax simple-atom, but perhaps there are other packages people use with which I am not aware?
Thanks, -Ryan
This package is current and maintained: http://hackage.haskell.org/package/intern Anthony

what does this package do? OK, I can read "efficient hash consing" but what does it mean exactly? and how would I actually use it? - J.W.

On 05/09/2013 12:56 PM, Johannes Waldmann wrote:
http://hackage.haskell.org/package/intern what does this package do? OK, I can read "efficient hash consing" but what does it mean exactly? and how would I actually use it? I can't tell you what it does, but there is an example - https://github.com/ekmett/intern/blob/master/examples/Term.hs

https://github.com/ekmett/intern/blob/master/examples/Term.hs
sure I found this but that still does not say much. I known generally what "hash consing" is (and that's why I think I might want to use this package) but I don't see what is the (implied) contract for this implementation: It looks like I need to write some instances (to make my typ "internable") but what properties should they have, and what properties of the functions defined in the package do I get in return? - J.W.

On Thu, 2013-05-09 at 11:56 +0000, Johannes Waldmann wrote:
what does this package do? OK, I can read "efficient hash consing" but what does it mean exactly? and how would I actually use it?
Hah. I read the same thing and came to exactly the same level of not-understanding. Thankfully edwardk is learning the value of putting documentation in his libraries! The only trouble is that he is so bloody prolific it might be a while before he gets around to explaining any particular one to the rest of us :) AfC Sydney
participants (5)
-
Andrew Cowie
-
Anthony Cowley
-
Johannes Waldmann
-
Oliver Charles
-
Ryan Newton