
8 Nov
2007
8 Nov
'07
9:33 a.m.
Hola Fernando,
On Nov 8, 2007 1:52 PM, Bayley, Alistair
First, you've given a type sig which suggests that f takes two arguments (both lists of type [a]) and returns a list of type [a]. However, there is only one argument to f. A type sig that better matches your function definition might be f :: [a] -> [a]
Alistair is surely aware of this, but, as a side note, and even if in this concrete case f might need to make the two arguments explicit, currying permits avoid specifing all the arguments (and it's used all the time by Haskell programmers) This two definitions are equivalent add1 :: Num a => [a] -> [a] add1 = map (+1) add1 :: Num a => [a] -> [a] add1 xs = map (+1) xs