<font face="verdana,sans-serif">Compile with -Wall and the flaw becomes obvious:</font><div><font face="verdana,sans-serif"><br></font></div><div><font face="verdana,sans-serif"><div>&lt;interactive&gt;:2:5:</div><div>    Warning: This binding for `+&#39; shadows the existing binding</div>

<div>               imported from `Prelude&#39; (and originally defined in `GHC.Num&#39;)</div><div><br></div><div>&lt;interactive&gt;:2:9:</div><div>    Warning: This binding for `*&#39; shadows the existing binding</div>

<div>               imported from `Prelude&#39; (and originally defined in `GHC.Num&#39;)</div><div><br></div><div>&lt;interactive&gt;:2:16:</div><div>    Warning: Defaulting the following constraint(s) to type `Integer&#39;</div>

<div>               (Num a0) arising from the literal `1&#39;</div><div>    In the first argument of `(+)&#39;, namely `1&#39;</div><div>    In the first argument of `(*)&#39;, namely `1 + 2&#39;</div><div>    In the expression: 1 + 2 * 3</div>

<div><br></div><div>&lt;interactive&gt;:2:16:</div><div>    Warning: Defaulting the following constraint(s) to type `Integer&#39;</div><div>               (Num a0) arising from the literal `1&#39; at &lt;interactive&gt;:2:16</div>

<div>               (Show a0) arising from a use of `print&#39; at &lt;interactive&gt;:2:1-34</div><div>    In the first argument of `(+)&#39;, namely `1&#39;</div><div>    In the first argument of `(*)&#39;, namely `1 + 2&#39;</div>

<div>    In the expression: 1 + 2 * 3</div><div><br></div><div>Shadowing is bad, and tends (as in this case) to be confusing.</div><div><br></div><div>  - Clark</div></font><br><div class="gmail_quote">On Fri, Oct 5, 2012 at 7:22 AM, Roman Cheplyaka <span dir="ltr">&lt;<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">* Johannes Waldmann &lt;<a href="mailto:waldmann@imn.htwk-leipzig.de">waldmann@imn.htwk-leipzig.de</a>&gt; [2012-10-05 11:11:48+0000]<br>


<div class="im">&gt; I was really surprised at the following:<br>
&gt;<br>
&gt; *Main&gt; 1 + 2 * 3<br>
&gt; 7<br>
&gt;<br>
&gt; *Main&gt; ( \ (+) (*) -&gt; 1 + 2 * 3 ) (+) (*)<br>
&gt; 9<br>
&gt;<br>
&gt; because I was somehow assuming that either<br>
&gt;<br>
&gt; a) the Prelude fixities of the operators are kept<br>
&gt; b) or they are undefined, so the parser rejects.<br>
&gt;<br>
&gt; but the Haskell standard says &quot;Any operator lacking a fixity declaration<br>
&gt; is assumed to be infixl 9&quot;. This really should be &quot;infix 9&quot;?<br>
<br>
</div>This behaviour is really handy when you use functions as operators<br>
(using backticks notation). They typically lack infix annotations, but<br>
having to put parentheses would be very annoying.<br>
<span class="HOEnZb"><font color="#888888"><br>
Roman<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<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></div>