[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

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
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the Haskell-Cafe mailing list