[Haskell-cafe] ask
Richard A. O'Keefe
ok at cs.otago.ac.nz
Mon Sep 15 00:21:14 EDT 2008
On 15 Sep 2008, at 12:51 pm, Daniel Fischer wrote:
> Am Montag, 15. September 2008 02:24 schrieb Cetin Sert:
>> Hi why do I get?
>
> Buffering. For compiled programmes, stdin and stdout are line-
> buffered by
> default, so the output doesn't appear until the program finishes.
> Either put
> hSetBuffering stdout NoBuffering
> at the top of main or, better IMO,
> insert a
> hFlush stdout
> into ask before the readLn.
> And in eval, putStrLn would be better, I think.
Is this the problem we've had before, where the example in the
Haskell 98 Report could not possibly work unless Haskell followed
the same rule as C (read from stdin *automatically* flushes stdout),
and the example works in several other Haskell systems, but not in
GHC? Or is this a different problem?
More information about the Haskell-Cafe
mailing list