
Stefan Monnier
While we're here, I'd be more interested in a dirty&fast comparison operation which could look like:
eq :: a -> a -> IO Bool
where the semantics is "if (eq x y) returns True, then x and y are the same object, else they may be different". Placing it in IO is not great since its behavior really depends on the compiler rather than on the external world, but at least it would be available.
What's "the same object"? Functions and values have no identity in Haskell. The best you can do is to ask, whether the arguments refer to the same thunk in memory (sharing), but as you say the answer isn't portable. It's also not much useful IMO. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://blog.ertes.de/