I'm studying Haskell since a little while, so I'm a newbie.
The following code is very easily understandable:
purStrLn $ show [1]
Here we can infer all the types (with defaults), and all works well. But the following code works, too:
putStrLn $ show []
even if we can't infer the list type.
If I execute the code with ghci I obtain the following:
Prelude> []
[]
Prelude> :t it
it :: [a]
Prelude>
so the type seems to be polymorphic. But in this case the show would be called with a partially applied type.
The same behavior is common with other types, for example with Data.Map.empty, so it isn't a list feature (or at least it seems like it).
Why and how it works?