[Haskell-beginners] Are these soloutions all valid and a good use of Haskell

Roelof Wobben r.wobben at home.nl
Mon Nov 10 20:48:11 UTC 2014


Roelof Wobben schreef op 10-11-2014 20:59:
> last5 :: [a] -> Maybe a
>    last5 = foldr acc Nothing where
>        acc x Nothing  = Just x
>        acc _ j        = j 

When I enter this in GHCI  I see this error :

Illegal type signature: ‘[a] -> Maybe a last5’





More information about the Beginners mailing list