[Haskell-cafe] Bug in "Haskell for C programmers" tutorial?

Erik de Castro Lopo hc-erikd at mega-nerd.com
Sat Dec 31 20:28:00 EST 2005


Cale Gibbard wrote:

> You shouldn't have to flush output manually. Which implementation are
> you using?

I'm using GHC.

> Try importing System.IO and doing:
> hGetBuffering stdout >>= print
> and see what gets printed. It should be "NoBuffering".

Nope, it says "LineBuffering".

> If for whatever
> reason it's not, you can set it to that at the start of your programs
> with
> hSetBuffering stdout NoBuffering

Ok, using that I can drop the hFlush and it works as expected.

Thanks,
Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"The lusers I know are so clueless, that if they were dipped in
 clue musk and dropped in the middle of pack of horny clues, on
 clue prom night during clue happy hour, they still couldn't get
 a clue."   --Michael Girdwood, in the monastery
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
Gambling(n): A discretionary tax on those asleep during high school
maths.


More information about the Haskell-Cafe mailing list