<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Dumb! I've been hacking Lisp and just slipped over to Haskell to check on something.<br><br>Thanks,<br><br>Michael<br><br>--- On <b>Sat, 1/16/10, VoidPrayer <i>&lt;voidprayer@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: VoidPrayer &lt;voidprayer@gmail.com&gt;<br>Subject: Re: [Haskell-cafe] What's going on here?<br>To: haskell-cafe@haskell.org<br>Date: Saturday, January 16, 2010, 10:05 PM<br><br><div class="plainMail">在 2010年 1月 17日 星期日 11:02:59,michael rice 寫道:<br>&gt; I don't see anything wrong with this function, which just subtracts 1 from<br>&gt;&nbsp; the first element of an Int list (if there is a first element).<br>&gt; <br>&gt; Michael<br>&gt; <br>&gt; My function:<br>&gt; <br>&gt; dropFirst :: [Int] -&gt; [Int]<br>&gt; dropFirst [] =
 []<br>&gt; dropFirst (x:xs) = (x-1) : xs<br>&gt; <br>&gt; My output:<br>&gt; &gt; :l dropfirst<br>&gt; <br>&gt; [1 of 1] Compiling Main&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;( dropfirst.hs, interpreted )<br>&gt; Ok, modules loaded: Main.<br>&gt; *Main&gt; dropFirst [3 4 5 6]<br><br>Use dropFirst [3,4,5,6], I think.<br><br>&gt; <br>&gt; &lt;interactive&gt;:1:11:<br>&gt;&nbsp; &nbsp;&nbsp;&nbsp;No instance for (Num (t -&gt; t1 -&gt; t2 -&gt; Int))<br>&gt;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;arising from the literal `3' at &lt;interactive&gt;:1:11-17<br>&gt;&nbsp; &nbsp;&nbsp;&nbsp;Possible fix:<br>&gt;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;add an instance declaration for (Num (t -&gt; t1 -&gt; t2 -&gt; Int))<br>&gt;&nbsp; &nbsp;&nbsp;&nbsp;In the expression: 3 4 5 6<br>&gt;&nbsp; &nbsp;&nbsp;&nbsp;In the first argument of `dropFirst', namely `[3 4 5 6]'<br>&gt;&nbsp; &nbsp;&nbsp;&nbsp;In the expression: dropFirst [3 4 5 6]<br>&gt; *Main&gt;<br>&gt;
 <br>_______________________________________________<br>Haskell-Cafe mailing list<br><a ymailto="mailto:Haskell-Cafe@haskell.org" href="/mc/compose?to=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></blockquote></td></tr></table><br>