Matthew Brecknell wrote:
Ketil Malde:
Perhaps this is an esoteric way, but I think the nicest approach is to
parse into a strict structure. If you fully evaluate each Email (or
whatever structure you parse into), there will be no unevaluated thunks
linking to the file, and it will be closed.
Not necessarily so, since you are making assumptions about the
timeliness of garbage collection.
Good point. I'd have hoped that the RTS would GC on file handle
exhaustion, but perhaps this is hard to do?
I think parsing input strictly is good practice anyway, since parsing is
often not very compute intensive, and tends to reduce the memory
required. At least, that is my experience.
-k
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe