Type of empty list
From HaskellWiki
1 Question
Why is
([]::[Int]) == ([]::[Char])
True
False
Related question: Why is
map :: (a -> b) -> [a] -> [b] map f (x:xs) = f x : map f xs map f xs@[] = xs
a type error and the case definition
map f [] = []
is not?
