
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. For instance, if someone is using /dev/watchdog to make their system automatically reboot when their userspace daemon fails, closing the file handle early would cause the watchdog functionality to be disabled, which is almost certainly not what someone would mean by `withFile "/dev/watchdog" $ \_ -> blah`. On 12/30/20 3:47 PM, Henning Thielemann wrote:
On Wed, 30 Dec 2020, David Feuer wrote:
withFile keeps the handle it creates alive until the user action completes. If we want to avoid this, we can.
Why should we? _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries