withFile defeats dead handle closure
David Feuer
david.feuer at gmail.com
Wed Dec 30 21:29:05 UTC 2020
To be clear, I wasn't formally proposing a change. I was trying to get
a sense of what people thought of the notion before going down too
many rabbit holes. I think Ryan Trinkle's concern is quite strong
enough to kill this idea as a change to `withFile` itself.
On Wed, Dec 30, 2020 at 4:26 PM Oliver Charles <ollie at ocharles.org.uk> wrote:
>
> While maybe not directly related to this, for many small changes suggested to base the answer is often: go write a library and see how it works out. This is often for fairly stylistic changes to "fringe" components of base. Here we're talking about a full blown operational change to something incredibly common. If anything, I think it would have to subject to the same process - try it out, really use it anger, see what breaks and - hopefully! - what gets better.
>
> On Wed, 30 Dec 2020, at 9:18 PM, Ryan Trinkle via Libraries wrote:
>
> I think David's suggestion may have been that withFile would still close
> the file at the end of the block, but would *also* close it if the
> handle died.
>
> On 12/30/20 4:05 PM, Henning Thielemann wrote:
> >
> > On Wed, 30 Dec 2020, Ryan Trinkle via Libraries wrote:
> >
> >> Although it might be nice to have a weak-reference-based alternative to
> >> withFile, I think it would be best to keep the behavior of withFile as
> >> predictable as possible (i.e. the current behavior), since closing a
> >> file can be semantically significant.
> >
> > Right, if I open and close and re-open a file, it must be closed
> > before I can re-open it.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
More information about the Libraries
mailing list