
3 Mar
2007
3 Mar
'07
2:10 a.m.
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.