
1 Jan
2006
1 Jan
'06
7:51 p.m.
On 01/01/06, Glynn Clements
Cale Gibbard wrote:
You shouldn't have to flush output manually. Which implementation are you using? Try importing System.IO and doing: hGetBuffering stdout >>= print and see what gets printed. It should be "NoBuffering".
The buffering for stdout should be LineBuffering if stdout is a terminal and BlockBuffering otherwise. The buffering for stderr should always be NoBuffering.
It's actually not, if you're starting your program from ghci, which is what confused me. From GHCi, you get NoBuffering on stdout, and LineBuffering on stdin, which is sane for interactive programs. Why anyone would want LineBuffering as default on stdout is somewhat mysterious to me. - Cale