Talk:Physical equality

From HaskellWiki
Revision as of 02:03, 20 December 2010 by David M (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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