[Haskell-beginners] invalid type signature last2::: [a] -> a

Roelof Wobben r.wobben at home.nl
Sun Nov 9 09:10:33 UTC 2014


I try to solve the 99 haskell problems on several ways.

But my first try which looks like this :

Last2::[a]-> a
Last2:: last[list]

gives the following error message :

src/Main.hs at 1:1-1:6
Invalid type signature: Last2 :: [a] -> a Should be of form <variable> 
:: <type>

What am trying to do is say the input is a list which can be of integers 
or chars so everything is the output can then also be of type everything.


More information about the Beginners mailing list