
17 Sep
2002
17 Sep
'02
1:33 a.m.
"Glynn Clements"
...chop, chop...
A deficiency of the current implementation of the IO system, I'd say. Reading from stdin ought to force a stdout (and stderr) buffer flush. The GHC IO libs used to do this.
The equivalent ANSI C I/O functions typically flush either all buffered output streams or all line-buffered output streams whenever a read operation is passed to the underlying system call (but not when it can be satisified from the input stream's buffer).
I'd settle for that kind of indiscriminate flushing -- as is, trivial I/O examples such as main = do putStr "What is your name? " ls <- getLine putStrLn ("Hello " ++ ls ++ "!") fail to behave as expected. --sigbjorn