
12 Jan
2002
12 Jan
'02
11:38 a.m.
module Main where main :: IO() main = do putStr "n:" n <- readLn :: IO(Int) print n
Used to work fine with ghc 5.00.2, that is, it would print "n:", then wait for the input, and finaly print n. With Ghc 5.02.2 it only prints "n:" after reading the n. <snip>
It's actually expected behaviour with the current IO implementation - you have to explicitly flush stdout before reading from stdin (if stdout is buffered, that is).
FWIW, I don't think this is the Right behaviour either.
Well it seems at least quite annoying, not to mention that lots of programs will 'break'. When was this behaviour changed? And why? J.A.