Basically just learning haskell, I would have posted this in the beginners list but since it involves a segfault of GHCI, I figured it might be worth posting here.  <br><br>I was
trying to get a good understanding of local variable scoping issues, so
I tried the following:<br>
<br>
f :: (Num a) =&gt; a -&gt; a<br>
f x = <br>
    let p = x*x<br>
    in<br>
        let p = x*p<br>
        in p<br>
<br>
I have some background in ML, which led me to believe that what should
happen here is that the function would return x^3.  Instead, GHCI just
completely terminates, I guess with a segfault.  What&#39;s the &quot;correct&quot;
behavior here?  Should it even compile?  I understand that you can&#39;t
redefine the same symbol twice in the same scope, so I tried this
specifically to see what would happen if you defined the same variable
again in a nested scope.  I thought it would just shadow the original
declaration, while still using the original p to calculate the value of
the new p.  I don&#39;t think the problem is the re-declaration of the same symbol in a nested scope (although if someone could clarify that would be nice), but rather the fact that I&#39;ve attempted to use the previous declaration of p in defining the new declaration of p.<br>

<br>
Would it be a safe assumption that a bug report should be submitted over this?