Personal tools

Talk:Physical equality

From HaskellWiki

Revision as of 02:03, 20 December 2010 by David M (Talk | contribs)

Jump to: navigation, search

Should the code not be

x === y = unsafePerformIO $ do
    px <- x `seq` newStablePtr x
    py <- y `seq` newStablePtr y
    let ret = px == py
    freeStablePtr px
    freeStablePtr py
    return ret

?

--David M, 20 Dec 2010

GHC already has physical equality testing via GHC.Exts.reallyUnsafePtrEquality#

--Lemmih 15:00, 29 July 2006 (UTC)


No need to talk about OCaml's nan: Prelude> 0/0 NaN Prelude> 0/0 == 0/0 False