
13 Oct
2014
13 Oct
'14
8:55 a.m.
On Mon, 13 Oct 2014, David Feuer wrote:
I was thinking
safeHGetContents :: (NFData a) => Handle -> (String -> a) -> IO a
and/or
safeHGetContents :: (NFData a) => Handle -> (String -> IO a) -> IO a
and/or something more explicitly targeting multiple handles (which I think there must be a nice way to do, somehow!).
I see. Then a better name might be DeepSeq.IO.withContents or DeepSeq.IO.withFileContents or DeepSeq.IO.hWithContents I still think, that 'safe' is not a good part of a Haskell function name, because 'safe' should be the default. If at all, we could rename hGetContents to unsafeHGetContents. A nested call to withContents would still run deepseq twice, right?