[Haskell-cafe] Physical equality

2010-06-28 Thread José Romildo Malaquias
Is there in Haskell a non monadic function of type a - a - Bool which test for physical equality of two values? It would return True if only if both values are the same object in memory. For instance: value1 = good value2 = good eq value1 value2 = False value1 = good value2 = value1

Re: [Haskell-cafe] Physical equality

2010-06-28 Thread Vo Minh Thu
2010/6/28 José Romildo Malaquias j.romi...@gmail.com: Is there in Haskell a non monadic function of type a - a - Bool which test for physical equality of two values? It would return True if only if both values are the same object in memory. For instance:  value1 = good  value2 = good  eq

Re: [Haskell-cafe] Physical equality

2010-06-28 Thread Thomas Davie
On 28 Jun 2010, at 09:38, José Romildo Malaquias wrote: Is there in Haskell a non monadic function of type a - a - Bool which test for physical equality of two values? It would return True if only if both values are the same object in memory. For instance: value1 = good value2 = good

Re: [Haskell-cafe] Physical equality

2010-06-28 Thread Sönke Hahn
On Monday, June 28, 2010 10:38:33 am José Romildo Malaquias wrote: Is there in Haskell a non monadic function of type a - a - Bool which test for physical equality of two values? It would return True if only if both values are the same object in memory. IIRC observable sharing does similar

Re: [Haskell-cafe] Physical equality

2010-06-28 Thread Edward Kmett
reallyUnsafePointerEquality :: a - a - Int# but don't use as it can give both false negatives (i.e. GC in the middle of evaluation) and false positives (that GC just finished and put one object right where the other was.) The better model to obtain what you want to use StableNames and seq and,