FW: cvs commit: hugs98/lib IO.hs Prelude.hs
Folks I plan to push out a new draft H98 report this week. Here is one suggested clarification from Sigbjorn, arising from recent uncertainty about the true meaning of getLine. I'll incorporate it unless anyone yells. Simon -----Original Message----- From: Simon Marlow Sent: 05 June 2002 10:27 To: Sigbjorn Finne; Simon Peyton-Jones Subject: RE: cvs commit: hugs98/lib IO.hs Prelude.hs Agree with everything Sigbjorn says below. Also: change the definition of getLine (section A.3) to be getLine = hGetLine stdin Cheers, Simon -----Original Message----- From: Sigbjorn Finne [mailto:sof@galois.com] Sent: 04 June 2002 16:17 To: Simon Peyton-Jones Cc: Simon Marlow Subject: Re: cvs commit: hugs98/lib IO.hs Prelude.hs How about the following: * change the Report (7.1) to say something along the lines of: getChar raises an exception (Section <http://research.microsoft.com/Users/simonpj/haskell98-revised/haskell98 -report-html/io-13.html#io-exceptions> 7.3) on end-of-file; a predicate isEOFError that identifies this exception is defined in the IO library. getLine raises an end-of-file exception under the same conditions as hGetLine in the IO library. * in the Library Report, say when hGetLine raises an exception: Computation hGetLine hdl reads a line from the file or channel managed by hdl. The Prelude's getLine is a shorthand for hGetLine stdin. Error reporting: the hWaitForInput, hReady and hGetChar computations may fail with: isEOFError if the end of file has been reached. hGetLine will also fail with isEOFError if end-of-file is encountered when reading the first character of the line. If hGetLine encounters end-of-file at any other point while reading in a line, it is treated as a line terminator and the (partial) line is returned. Actually, I'd prefer if 11.7.1 only dealt with hWaitForInput and hReady (as they're the "checking for input" operations). A second section, named "Reading input", would then be concerned with hGetChar and hGetLine. --sigbjorn ----- Original Message ----- From: "Simon Peyton-Jones" < <mailto:simonpj@microsoft.com> simonpj@microsoft.com> To: "Sigbjorn Finne" < <mailto:sof@glass.cse.ogi.edu> sof@glass.cse.ogi.edu>; < <mailto:simonmar@microsoft.com> simonmar@microsoft.com> Sent: Tuesday, June 04, 2002 04:03 Subject: RE: cvs commit: hugs98/lib IO.hs Prelude.hs
Should I change the Report wording to be clearer?
Simon
| -----Original Message----- | From: Sigbjorn Finne [mailto:sof@glass.cse.ogi.edu] | Sent: 03 June 2002 15:49 | To: <mailto:cvs-hugs@haskell.org> cvs-hugs@haskell.org | Subject: cvs commit: hugs98/lib IO.hs Prelude.hs | | | sof 2002/06/03 07:49:12 PDT | | Modified files: | lib IO.hs Prelude.hs | Log: | Interpret Report wording for Prelude.getLine and IO.hGetLine | to mean the Right Thing. If EOF is encountered for a partial | line (>= 1 chars), interpret this as '\n'. | | Revision Changes Path | 1.4 +25 -8 hugs98/lib/IO.hs | 1.25 +23 -5 hugs98/lib/Prelude.hs | _______________________________________________ | Cvs-hugs mailing list | <mailto:Cvs-hugs@haskell.org> Cvs-hugs@haskell.org <http://www.haskell.org/mailman/listinfo/cvs-hugs> http://www.haskell.org/mailman/listinfo/cvs-hugs |
participants (1)
-
Simon Peyton-Jones