
8 Dec
2009
8 Dec
'09
4:01 a.m.
On Tue, Dec 8, 2009 at 1:48 AM, Michael Vanier
Do you mean symbols as in "interned strings with an O(1) string comparison method"? I would love to have those, but I don't see an easy way to get it without being in the IO or ST monad.
data Sym = Sym String Hash fromString :: String -> Sym fromString s = Sym s (hash s) instance Eq Sym where Sym _ h == Sym _ h' = h == h' Much as I am uncomfortable with hash-based equality. 1/2^256, despite being very small, is not zero. It is begging for a mysterious failure someday. Luke