[Haskell-cafe] Re: Are handles garbage-collected?
simons at cryp.to
Sun Oct 24 10:19:54 EDT 2004
Remi Turk writes:
>> Assuming I could _not_ use 'bracket', 'withFile',
>> 'finally' or any of the other usual scope-guarding
>> techniques [...]
> Refactoring comes to the mind... ;)
I wish that were possible! I use bracket-style resource
allocation wherever I can, but in this case the Handle is
the _result_ of a rather complex computation, so it has to
leave the scope in which is was opened. A finalizer is all I
That is the function I was looking for.
Well, it's actually not at all the function I was looking
for, but given the circumstances, it seems to be the only
solution. Alternatives are highly sought after, though!
More information about the Haskell-Cafe