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



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to