Open mitchellwrosen opened 8 years ago
The documentation of writeFile say that the handle is "crudely" managed by ResourceT. I'm curious, what is crude about this?
writeFile
ResourceT
Would using monad-control be less crude? i.e.:
monad-control
writeFile :: MonadBaseControl IO m => FilePath -> Stream (Of String) m r -> m r writeFile path stream = control (\unlift -> IO.withFile path IO.WriteMode (\handle -> unlift (toHandle handle stream)))
Thanks.
I believe the crudeness is what I'm talking about in #23 - it won't always release the file handle resource as soon as it can.
The documentation of
writeFile
say that the handle is "crudely" managed byResourceT
. I'm curious, what is crude about this?Would using
monad-control
be less crude? i.e.:Thanks.