
3 Mar
2007
3 Mar
'07
4:21 a.m.
Well, C stdio has this nice thing that if you read from stdin then stdout is automagically flushed first (maybe only if both are ttys). I think Haskell should have that too. -- Lennart On Mar 3, 2007, at 07:10 , Bryan O'Sullivan wrote:
Joe Olivas wrote:
However, changing 'putStrLn' to 'putStr' does not do what I would expect. The prompt doesn't get displayed until after there is input:
This isn't a Haskell issue per se. The runtime is putting stdout into line-buffered mode, so you need to import System.IO and use hFlush stdout to get it to flush your prompt string out of its buffer. You'd see the same behaviour in C (if using stdio), Python, etc.
http://www.haskell.org/mailman/listinfo/haskell-cafe