<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks all. <br>
<br>
I have now this : <br>
<br>
-- | The main entry point.<br>
last' :: [a] -> Maybe a<br>
last' [] = Nothing<br>
last' [x] = Just x <br>
last' (_:xs) = last' xs<br>
<br>
<br>
main = print . last' [1,2,3]<br>
<br>
but I see this message about main : <br>
<br>
<i>
GHC threw an exception : Couldn't match expected type
‘GHC.Types.IO a0’ with actual type ‘a1 -> GHC.Types.IO ()’
<br>
<br>
I work wih the fpcomplete and they demand a main in the code .<br>
<br>
Roelof<br>
<br>
</i><br>
<br>
<br>
Nicolas SCHOEMAEKER schreef op 12-5-2015 om 11:45:<br>
</div>
<blockquote
cite="mid:96ee8535-1252-45f1-8f39-abb47e4a7c56@typeapp.com"
type="cite">
<p dir="ltr">Hi</p>
<p dir="ltr">In your definition, you seem to have forgotten the
case when your list is empty.<br>
[x] won't bind on [].</p>
<p dir="ltr">Regards,<br>
Nicolas SCHOEMAEKER</p>
<p dir="ltr">(<i>This email was composed from a mobile phone,
please</i><i> excuse</i><i> any resulting mistakes</i>)</p>
<p dir="ltr">Web, Cloud Computing & WebRTC developer<br>
Haskell Programmer<br>
Artificial Intelligence & Robotics enthusiast</p>
<div class="gmail_quote">On May 12, 2015, at 11:40 AM, Kim-Ee Yeoh
<<a moz-do-not-send="true" href="mailto:ky3@atamo.com"
target="_blank">ky3@atamo.com</a>> wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div dir="ltr">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, May 12, 2015 at 1:42 PM,
Roelof Wobben <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:r.wobben@home.nl" target="_blank">r.wobben@home.nl</a>></span>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><span
class=""> -- | The main entry point.<br>
last' :: [a] -> a <br>
</span> last' [x] = x <br>
<span class=""> last' (x:xs) = last xs</span></blockquote>
</div>
<br>
</div>
<div class="gmail_extra">Notice that the last line does no
recursion: it invokes the Prelude's definition of last.<br>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail_signature">-- Kim-Ee</div>
</div>
</div>
</div>
<pre class="blue"><hr>
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@haskell.org">Beginners@haskell.org</a>
<a moz-do-not-send="true" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a>
</pre>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@haskell.org">Beginners@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a>
</pre>
</blockquote>
<br>
<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
<tr>
<td style='border:none;padding:0px 15px 0px 8px'>
<a href="http://www.avast.com/">
<img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" />
</a>
</td>
<td>
<p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
<br><a href="http://www.avast.com/">www.avast.com</a>
</p>
</td>
</tr>
</table>
<br />
</body>
</html>