<br><br><div class="gmail_quote">2012/6/26 Lorenzo Bolla <span dir="ltr">&lt;<a href="mailto:lbolla@gmail.com" target="_blank">lbolla@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The point I was making is that StableName might be what you want. You are using it to check if two functions are the same by comparing their &quot;stablehash&quot;. But from StableName documentation:<div><br><div><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
The reverse is not necessarily true: if two stable names are not equal, then the objects they name may still be equal. </blockquote><div><br></div></div><div>The `eq` you implemented means this, I reckon: if `eq` returns True then the 2 functions are equal, if `eq` returns False then you can&#39;t tell!</div>

<div><br></div><div>Does it make sense?</div><span class="HOEnZb"><font color="#888888"><div>L.</div></font></span></div></div></blockquote><div><br></div><div>Yes  it does make sense, and I&#39;m wondering why the hash are equal in one case but are not equal on the other case (i.e. using let/where vs not using it) because I&#39;d like it to behave the same in both situations </div>
<div><br></div><div>Thanks again</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div><div class="h5"><div><br></div><div><br><div class="gmail_quote">
On Tue, Jun 26, 2012 at 1:54 PM, Ismael Figueroa Palet <span dir="ltr">&lt;<a href="mailto:ifigueroap@gmail.com" target="_blank">ifigueroap@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks Lorenzo, I&#39;m cc&#39;ing the list with your response also:<div><br></div><div>As you point out, when you do some kind of &quot;let-binding&quot;, using the where clause, or explicit let as in:</div>

<div><br></div>
<div><div><div>main :: IO () </div><div>main = do</div></div><div>       let f1 = (successor :: Int -&gt; State Int Int)</div><div>       let f2 = (successor :: Int -&gt; Maybe Int)</div><div><div>       b2 &lt;- eq f2 f2</div>

<div>       b1 &lt;- eq f1 f1</div>
<div>       print (show b1 ++ &quot; &quot; ++ show b2)</div></div></div><div><br></div><div>The behavior is as expected. I guess the binding triggers some internal optimization or gives more information to the type checker; but I&#39;m still not clear why it is required to be done this way -- having to let-bind every function is kind of awkward.</div>


<div><br></div><div>I know the details of StableNames are probably implementation-dependent, but I&#39;m still wondering about how to detect / restrict this situation.</div><div><br></div><div>Thanks</div><div><div><div>

<br><br><div class="gmail_quote">
2012/6/26 Lorenzo Bolla <span dir="ltr">&lt;<a href="mailto:lbolla@gmail.com" target="_blank">lbolla@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">