FW: showing Handle is impure

Alastair Reid alastair@reid-consulting-uk.ltd.uk
Mon, 21 Jul 2003 17:51:48 +0100


> 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