Interesting code, it was nice to read, thanks! Just a few minor
comments.
On Thu, Jan 14, 2010 at 11:33:54PM +0000, Thomas Schilling wrote:
> intern s = unsafePerformIO $ do
> lnk <- newIORef Nothing
> r <- newIORef $ SymInfo (hash s) lnk s
> return (Symbol r)
>
> mkSymbolInfo :: String -> SymbolInfo
> mkSymbolInfo s = unsafePerformIO $ do
> lnk <- newIORef Nothing
> return $ SymInfo (hash s) lnk s
intern = fmap Symbol . newIORef . mkSymbolInfo
> -- END OF COMMON CASE
> --
> -- If the symbols have been built using the same symbol table
> -- we will only reach this case if we have a hash collision or
> -- the symbols were built from different symbol tables.
-- END OF COMMON CASE
--
-- We will only reach this case if we have a hash collision or
-- the symbols were built from different symbol tables.
Thanks for sharing,
--
Felipe.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe