Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writeFile type #17

Open
mitchellwrosen opened this issue Sep 8, 2016 · 1 comment
Open

writeFile type #17

mitchellwrosen opened this issue Sep 8, 2016 · 1 comment

Comments

@mitchellwrosen
Copy link
Contributor

mitchellwrosen commented Sep 8, 2016

The documentation of writeFile say that the handle is "crudely" managed by ResourceT. I'm curious, what is crude about this?

Would using monad-control be less crude? i.e.:

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.

@ocharles
Copy link

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.

mitchellwrosen pushed a commit to mitchellwrosen/streaming that referenced this issue Dec 9, 2017
Add differently-constrained maps and mapped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants