[Haskell-cafe] Very Basic IO question
lennart at augustsson.net
Sat Mar 3 04:21:29 EST 2007
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.
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.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe