
12 Mar
2009
12 Mar
'09
8:48 a.m.
Francesco Bochicchio wrote:
But I don't understand because it says that 1 [1,2,3] is a single argument...
Oh yes, because syntactically it looks like you want to apply the function '1' to the argument '[1,2,3]', the result being '1 [1,2,3]'
Yes, the error messages indicate that GHC is parsing the expression as (take) - (1 [1,2,3]) and consequently complains that take :: Int -> [a] -> [a] is not a number (i.e. an instance of class Num) and that it can't interpret the inferred type of 1 :: [t] -> (type of take) as a Num . Regards, apfelmus -- http://apfelmus.nfshost.com