
21 Jul
2003
21 Jul
'03
12:51 p.m.
I've changed GHC's implementation so that it now displays just the filename from the Handle (this is the the only immutable part of the Handle). This raises another question though: should there be an IO operation for displaying the more interesting parts of a Handle? I propose:
System.IO.hShow :: Handle -> IO String
Sounds good. I'm a little surprised that there always is a filename though - I thought (but haven't bothered to check) that Handles were used for anything that can contain a file descriptor: files, pipes, network connections, etc. No big deal but what is the output in these cases? (The file descriptor number suggests itself - immutable though not necessarily unique.) -- Alastair