"Cagdas Ozgenc" <[EMAIL PROTECTED]> writes:
> The following function generates a type error.
>
> headColumnwise :: [a] -> a
> headColumnwise line = [ head line | line <- p ]
Surely, the parameter should be "p"?
> ERROR ch6ex1.hs:14 - Inferred type is not general enough
> *** Expression : headColumnwise
> *** Expected type : [a] -> a
> *** Inferred type : [[a]] -> [a]
> it compiles fine. Isn't [a]->a the most general type here?
If p is [a], then line (drawn from p) must be of type a. But you do
"head line", which implies that line (and thus a) is a list.
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell