[Haskell-cafe] Why aren't files flushed at exit?

Paul Johnson paul at cogito.org.uk
Sun Jul 17 15:41:49 CEST 2011


If you open a file for writing and then exit with output unflushed, then 
Haskell does not flush the file for you.  In ghci the program seems to 
work, but then when you compile it in ghc it mysteriously fails.

I've just been bitten by this, but when I went to the bug tracker I 
found http://hackage.haskell.org/trac/ghc/ticket/4119 ticket 4119, which 
describes this behaviour and was resolved as "invalid".  So presumably 
this behaviour is by design.

Given that most environments get this right, why doesn't Haskell?

Paul.



More information about the Haskell-Cafe mailing list