
So that's a third variant of runtime behaviour, then, for the same trivial program (probably cygwin on a more modern windows?)!?
What do other GHC versions say? And, more importantly, what _should_ they do?
GHC 5.04.3 behaves as I'd expect, except that it defaults to BlockBuffering for stdin/stdout in a cygwin window. In a DOS window it defaults to LineBuffering as expected. This appears to be because mingw's implementation of isatty() only detects DOS windows, which is reasonable.
Strangely, with Blockbuffering the program seems to be slightly better behaved than with LineBuffering in cygwin, so the "cat"-hack helps a bit ("strangely", because I'm reading lines, so I'd usually explicitly set LineBuffering.., and "slightly better", because it's still not quite as I would have expected).
I'd still like to understand what's going on and how to get my Haskell programs to behave (this arises in a debugging mode of a larger app and means that, at the moment, I can't easily use this for debugging, which makes life slightly difficult, but at least it doesn't seem to cause the bug*..).
I think just upgrading your GHC should fix things. If not, we'll look into it. Cheers, Simon
participants (1)
-
Simon Marlow