[Haskell-cafe] Type error with simple list function
Fernando Rodriguez
frr149 at easyjob.net
Thu Nov 8 07:20:26 EST 2007
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
More information about the Haskell-Cafe
mailing list