[Haskell-cafe] Unwrapping long lines in text files

Brandon S Allbery KF8NH allbery at ece.cmu.edu
Sat Aug 14 19:17:41 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/14/10 19:07 , Ben Millwood wrote:
> Strangely, it prints this before the output of your program - this
> isn't terribly important, but for the sake of completeness, it's
> because of the different buffering characteristics of stdout and
> stderr, which confusingly mean that even though your program produces
> output and then produces an error, the error is printed immediately
> while the output waits until the program is terminated to be produced.
> I think. Something like that, anyway.

My guess is he's redirecting stdout and stderr to the same file, and stderr
happens to get flushed by the Haskell runtime before stdout (possibly
because a flush is performed regardless when an exception is printed).  It
is, as you note, not really relevant to the actual logic error leading to
the exception.

- -- 
brandon s. allbery     [linux,solaris,freebsd,perl]      allbery at kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university      KF8NH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxnJBUACgkQIn7hlCsL25X7jACgzk4uCCP/1LBDfgtRU0vfobZI
+BgAn2oabimC8tKOII6xBC+LM41oTpqd
=q1sj
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list