Sorry for having strayed towards a different path. I'll try to answer only your question this time :)
An example from [1], for SML (bottom of the page) shows a function, with the following type signature in haskell
copyTextFile :: String -> String
One cannot write such a function in haskell that does the same thing because the example uses IO within a function with a pure looking type.
I'm sure people experienced with other functional languages will have good examples, so I'll leave it to them.
To answer your second question, I'm still not sure :).
I was just relaying how I understood purity, so that somebody might also correct me if I'm wrong.
Summarizing the discussion above, a function is pure if it gives the same output for the same input. Now a function returning 'IO a' always returns the same IO instructions (these instructions might be impure), but the function (by the virtue of always returning the same output for the same inputs) is ultimately pure. Frerich has also raised an important point that an IO computation might actually depend on some random file, which breaks this pattern.