[<<][compsci][>>][..]
Sun Feb 14 11:29:56 CET 2010

Haskell pointer equality

import System.IO.Unsafe
import System.Mem.StableName

ptrEqual :: a -> a -> IO Bool
ptrEqual a b = do
  a' <- makeStableName a
  b' <- makeStableName b
  return (a' == b')

termRefEq :: (Eq a) => (Term a) -> (Term a) -> Bool
termRefEq x y = unsafePerformIO $ ptrEqual x y



[Reply][About]
[<<][compsci][>>][..]