[Haskell-cafe] Very Basic IO question

Bryan O'Sullivan bos at serpentine.com
Sat Mar 3 02:10:28 EST 2007


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.

	<b


More information about the Haskell-Cafe mailing list