[Haskell-cafe] xs not in scope

Roelof Wobben r.wobben at home.nl
Sun Nov 9 16:38:26 UTC 2014


Hello,

Im trying to find several answers to problem1 of the 99 haskell problems.
Find the last item in a list.

Now im trying to find a guarded solution.
So far I have this:

last3::[a]-> Maybe a;
last3 a
   | [] = Nothing
   | ([a]) = Just a
   | (_:xs) = last3 xs

But I see this error messages :

src/Main.hs at 10:8-10:10Not in scope: xs

How to solve this ?

Roelof




More information about the Haskell-Cafe mailing list