Next | Atypical Types | 58 |
map :: | (a -> b, [a]) -> [b] |
f :: | a -> b |
h :: | a |
t :: | [a] |
"map must return [b]."
map(f, []) = [] map(f, h:t) = f(h) : [map(f, t)
"That fits with the return value in the other clause."
"Everything else checks out okay."
If you ask the compiler, it will say that the type is:
map :: (a -> b, [a]) -> [b]
Next | Copyright © 1999,2008 Mark Dominus |