20 Feb
2003
20 Feb
'03
4:01 a.m.
The definition of getLine given in 8.3: getLine :: IO String getLine = do c <- getChar if c == '\n' then return "" else do s <- getLine return (c:s) is incorrect in view of 7.1: The getLine operation raises an exception under the same circumstances as hGetLine, defined [in] the IO library. ("in" is missing from the published Report.) 21.9.2: The hGetLine computation fails with isEOFError if the 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.
8632
Age (days ago)
8632
Last active (days ago)
0 comments
1 participants
participants (1)
-
Ross Paterson