Bulat Ziganshin wrote:

reading GHC sources is always very interesting :)
that is from GHC/Base.hs :

getTag :: a -> Int#
getTag x = x `seq` dataToTag# x

! This is just what I was looking for, thankyou.

My shallowEq function is now simply:

shallowEq :: a -> a -> Bool
shallowEq a b = getTag a ==# getTag b

My project is already totally reliant on GHC, and this will save me the heartache of hacking DrIFT (which I was in the process of setting up when I saw this mail) into my makefile.

Portability be damned!

Ben.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to