<br><br>
<div class="gmail_quote">2009/3/12 7stud <span dir="ltr">&lt;<a href="mailto:bbxx789_05ss@yahoo.com">bbxx789_05ss@yahoo.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">7stud &lt;bbxx789_05ss &lt;at&gt; <a href="http://yahoo.com/" target="_blank">yahoo.com</a>&gt; writes:<br>&gt;<br>&gt; Why does<br>&gt;<br>&gt; take (0 - 1) [1, 2, 3]<br>&gt;<br>&gt; produce a result but not<br>
&gt;<br>&gt; take -1 [1, 2, 3]<br>&gt;<br>&gt; ?  Thanks<br>&gt;<br><br></div>Well, immediately after I hit the submit button, I thought I&#39;d try this:<br>
<div class="im"><br>*Main&gt; take (-1) [1, 2, 3]<br></div>[]<br><br>So why are the parentheses needed there?<br>
<div>
<div></div>
<div class="h5"><br> </div></div></blockquote>
<div> </div>
<div>I think because take -1 [1,2,3] is parsed as (take  - 1 ) [1,2,3] or something like that.</div>
<div>If you look to the error message, and translate the haskellese in plain english, it says so.  </div>
<div> </div>
<div>&quot;In the second argument of `(-)&#39;, namely `1 [1, 2, 3]&#39; &quot; : </div>
<div>so it looks like is looking for the two arguments of infix operator (-), the first being &#39;take&#39;.</div>
<div>But I don&#39;t understand because it says that 1 [1,2,3] is a single argument...<br></div>
<div>&quot;In the definition of `it&#39;: it = take - 1 [1, 2, 3]&quot;<br>notice the blank between the minus sign and 1: even if you write -1, it understands - 1.</div>
<div> </div>
<div>So, ghc is trying to be helpful here :-)</div>
<div> </div>
<div>Ciao</div>
<div>-----</div>
<div>FB</div></div>