reallyUnsafePointerEquality :: a -&gt; a -&gt; Int#<br><br>but don&#39;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.)<br>
<br>The better model to obtain what you want to use StableNames and seq and, if you must, a little bit of unsafePerformIO, but note that this means that side-effects and various inlining/sharing improvements caused by the usual compilation process that previously were non-observable become critical to the correctness of your function, which is why the result is in IO to begin with. <br>
<br>Typically you can construct something purely and inspect the result using IO all in one go, so the unsafePerformIO machinery isn&#39;t required.<br><br>-Edward Kmett<br><br><div class="gmail_quote">2010/6/28 José Romildo Malaquias <span dir="ltr">&lt;<a href="mailto:j.romildo@gmail.com">j.romildo@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Is there in Haskell a non monadic function of type a -&gt; a -&gt; Bool which<br>
test for physical equality of two values? It would return True if only<br>
if both values are the same object in memory.<br>
<br>
For instance:<br>
<br>
  value1 = &quot;good&quot;<br>
  value2 = &quot;good&quot;<br>
<br>
  eq value1 value2 =&gt; False<br>
<br>
  value1 = &quot;good&quot;<br>
  value2 = value1<br>
<br>
  eq value1 value2 =&gt; True<br>
<font color="#888888"><br>
Romildo<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>