
8 Nov
2007
8 Nov
'07
7:20 a.m.
Hi, This simple function definition that should rotate a list (put the first item in the last place) fails with a rather cryptic error with ghc: f :: [a] ->[a] ->[a] f (w : ws) = ws : w Couldn't match expected type `[a] -> [a]' against inferred type `[[a]]' In the expression: ws : w In the definition of `f': f (w : ws) = ws : w What's Haskell trying to tell me? I'm a newby so please forgive my ignorance. Thanks! Fernando