| Ralf Hinze wrote:
| 
| > Hmm. Perhaps I am missing something but why is my statement not
| > correct? [Isn't this a consequence of parametricity?] `show []'
| > should produce `[]' and `show ""' should produce `""'. If the
| > argument of `show' has type `forall a.[a]', then we can supply
| > any dictionary we like. Because an element of type `forall a.[a]'
| > cannot contain any elements.
| 
| But you'e contradicting yourself!  So if the dictionary doesn't matter
| then I'll pass the Char dictionary for `show []'.  It will print as `""'.
| Are you happy with that?
| Just because the type tells you that there can be no elements
| doesn't mean that the dictionary isn't used.  Look at the Show class
| and how it cleverly uses a different method to show a list.

Thanks for the enlightment. Finally, I got the point. It's the magical
`Show' trick.

Still unhappy, Ralf

Reply via email to