[Haskell-cafe] Re: Are handles garbage-collected?
k.schupke at imperial.ac.uk
Sun Oct 24 13:04:25 EDT 2004
> The _result_ of a rather complex computation, so it has to
return a function that returns the handle.
handleOpener = complex function
bracket handleOpener close (\h -> do
Peter Simons wrote:
>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
> > performGC
>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!
>Haskell-Cafe mailing list
>Haskell-Cafe at haskell.org
More information about the Haskell-Cafe