[Haskell-beginners] why is this type wrong

Kim-Ee Yeoh ky3 at atamo.com
Tue May 12 09:39:47 UTC 2015


On Tue, May 12, 2015 at 1:42 PM, Roelof Wobben <r.wobben at home.nl> wrote:

-- | The main entry point.
> last' :: [a] -> a
> last' [x] = x
> last' (x:xs) = last xs


Notice that the last line does no recursion: it invokes the Prelude's
definition of last.

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150512/38810bc6/attachment.html>


More information about the Beginners mailing list