Discussion: Add safeWithFile function

Henning Thielemann lemming at henning-thielemann.de
Sun Oct 12 16:14:22 UTC 2014


On Sun, 12 Oct 2014, Oliver Charles wrote:

> Where are you suggesting this library goes? Your `safeWithFile` needs `NFData`, but that's in `deepseq` which
> isn't a dependency of `base`.

It would certainly be located in 'deepseq' or a dependent library. Maybe 
Control.DeepSeq.IO.withFile would be good. Then it would be clear, that it 
is just a deepseq variant of withFile.

I would not like the name safeWithFile, because withFile is already safe. 
It's hGetContents that is unsafe.


More information about the Libraries mailing list