simonmar    2003/07/21 09:50:21 PDT

  Modified files:
    libraries/base/GHC   Handle.hs IOBase.lhs 
  Log:
  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.
  
  Revision  Changes    Path
  1.23      +85 -41    fptools/libraries/base/GHC/Handle.hs
  1.32      +17 -52    fptools/libraries/base/GHC/IOBase.lhs
_______________________________________________
Cvs-libraries mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to