[project @ 2003-07-21 16:50:20 by simonmar]
GHC's instance Show Handle is wrong, because it is impure. This
commit makes the Show instance pure by restricting what it shows to
just the filename.
I moved the filename from the Handle__ (the mutable portion of the
Handle) to the Handle proper, to facilitate this. This might result
in a small performance improvment because Handle__ is now slightly
smaller.
Also added:
GHC.Handle.hShow :: Handle -> IO String
which provides the old functionality, but now in the IO monad.
Pending discussion on the libraries list, this may be exposed by
System.IO.
Also, while I was here, I did something I've been meaning to do for a
long time: change the godawful IOError Show instance.
Previously:
illegal operation
Action: hGetChar
Handle: {loc=<stdin>,type=semi-closed,binary=False,buffering=block (8192)}
Reason: handle is closed
File: <stdin>
Now:
<stdin>: hGetChar: illegal operation (handle is closed)
This is going to result in a bunch of test failures, but I'll deal
with those later.