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

Felipe Almeida Lessa felipe.lessa at gmail.com
Sun Jul 17 19:47:49 CEST 2011


On Sun, Jul 17, 2011 at 1:40 PM, Donn Cave <donn at avvanta.com> wrote:
> The use of withFile on the main function is a good practice in Haskell
> only because of this defect in the GHC library implementation.

Well, I've always closed my handles on all languages I've programmed.
Actually, now I remember that some students were bitten by the same
bug in Pascal.

> There's no question, if there were two competing Haskell library
> implementations, GHC and one that worked like buffered I/O in other
> languages, which one would better support Haskell programmers.
> It's too bad that doesn't qualify it as "valid" bug.

Having this feature may be nice if you ever forget to close your
handles.  But if this is a good practice or not is an orthogonal
issue.  (Actually it is a non-issue because only one of the practices
work today =P).

Cheers,

-- 
Felipe.



More information about the Haskell-Cafe mailing list