[Haskell-cafe] Re: Are handles garbage-collected?
Keean Schupke
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.
for example:
handleOpener = complex function
bracket handleOpener close (\h -> do
Keean
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
>can use.
>
>
> > 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!
>
>Peter
>
>
>_______________________________________________
>Haskell-Cafe mailing list
>Haskell-Cafe at haskell.org
>http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
More information about the Haskell-Cafe
mailing list