<div class="gmail_quote">On Mon, Jun 22, 2009 at 12:06 PM, Malcolm Wallace <span dir="ltr">&lt;<a href="mailto:Malcolm.Wallace@cs.york.ac.uk">Malcolm.Wallace@cs.york.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">Erik de Castro Lopo &lt;<a href="mailto:mle%2Bhs@mega-nerd.com">mle+hs@mega-nerd.com</a>&gt; wrote:<br>
<br>
&gt; Vasili I. Galchin wrote:<br>
&gt;<br>
</div><div class="im">&gt; &gt;  &quot;where/let&quot; functions use the<br>
&gt; &gt; same name for function parameters as the outer function and hence<br>
&gt; &gt; there is a &quot;shadow&quot; warning from the compiler.<br>
&gt;<br>
</div><div class="im">&gt; In Haskell there is an easy way around this. Variables can<br>
</div>&gt; be name a, a&#39;, a&#39;&#39; and so on. ...<br>
&gt; ... its a good idea to fix these warnings.<br>
<br>
I would _strongly_ advise not to do that.  By trying to silence the<br>
spurious warning about shadowing, there is enormous potential to<br>
introduce new bugs that were not there before.<br>
<br>
Example:<br>
<br>
  f a b = g (a+b) (b-a)<br>
        where g a c = a*c<br>
<br>
ghc warns that g&#39;s parameter a shadows the parameter to f.  So we<br>
introduce a primed identifier to eliminate the warning:<br>
<br>
  f a b = g (a+b) (b-a)<br>
        where g a&#39; c = a*c<br>
<br>
Now, no warnings!  But, oops, this function does not do the same thing.<br>
We forgot to add a prime to all occurrences of a on the right-hand-side.<br></blockquote></div><br>Actually there&#39;s a warning:<br><br>ghci&gt; let f a b = g (a+b) (b-a) where g a&#39; c = a*c<br><br>&lt;interactive&gt;:1:34: Warning: Defined but not used: `a&#39;&#39;<br>

<br>Cheers,<br><br>Johan<br><br>