> I would like to have a comparison instruction that compares the internal > reference of two objects. > Let's call it "req". > > req :: a -> a -> Bool By coincidence, I was just looking at GHC's documentation on stable names and pointers, and it seems relevant here. http://research.microsoft.com/users/t-simonm/ghc/Docs/latest/libraries/libs- 14.html Something like this might do the job for you: req a b = unsafePerformIO $ do a' <- makeStableName a b' <- makeStableName b return (a' == b') --FC
- Again: Referential Equality Andreas C. Doering
- RE: Again: Referential Equality Simon Peyton-Jones
- RE: Again: Referential Equality Frank A. Christoph
- RE: Again: Referential Equality Andreas C. Doering
- Re: Again: Referential Equality Wolfram Kahl
- RE: Again: Referential Equality Simon Marlow
- RE: Again: Referential Equality D. Tweed
- Re: Again: Referential Equality Lennart Augustsson
- Re: Again: Referential Equality Koen Claessen
- RE: Again: Referential Equality Theo Norvell
- Re: Again: Referential Equality Hans Aberg
- RE: Again: Referential Equality Frank A. Christoph
- Re: Again: Referential Equality Fergus Henderson