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

Reexport 'hFlush' #314

Closed
chshersh opened this issue Jul 7, 2020 · 4 comments · Fixed by #323
Closed

Reexport 'hFlush' #314

chshersh opened this issue Jul 7, 2020 · 4 comments · Fixed by #323
Labels
reexport Reexport something new

Comments

@chshersh
Copy link
Contributor

chshersh commented Jul 7, 2020

And lift to MonadIO

@chshersh chshersh added the reexport Reexport something new label Jul 7, 2020
@chshersh chshersh added this to the v0.8.0.0: Standard milestone Jul 7, 2020
@rektrex rektrex mentioned this issue Jul 10, 2020
10 tasks
@rektrex
Copy link
Collaborator

rektrex commented Aug 13, 2020

@chshersh, I would like to try to make the changes using the new module structure.

@chshersh
Copy link
Contributor Author

@rektrex The idea is to create a separate module called Relude.Lifted.Handle and put lifted and specialized versions of useful Handle-related functions in there. The module has a lot of functions, and we can always expand reexports when necessary. But I think that the following functions are useful at the moment:

  • hFlush
  • hIsEOF
  • BufferMode
  • hSetBuffering
  • hGetBuffering

Additionally, it would be nice to move the following Handle definitions from Relude.Base to the new module Relude.Lifted.Handle for the sake of consistency:

  • Handle
  • stdin
  • stdout
  • stderr
  • withFile (note, that even if withFile function has IO in its type, we can't lift this function properly, so we just don't touch it and reexport as it is)

After that, we can reexport add Relude.Lifted.Handle from Relude.Lifted.

Adding HLint rules for all these functions would be great as well!

Also, adding @since 0.8.0.0 annotations to the module and all new functions would be appreciated 🙂

@rektrex
Copy link
Collaborator

rektrex commented Aug 13, 2020

Additionally, it would be nice to move the following Handle definitions from Relude.Base to the new module Relude.Lifted.Handle for the sake of consistency

Sorry, I don't understand this part.

I'll start with the other parts.

Edit: BufferMode is not a function, right? Did you have some other function in your mind?

@chshersh
Copy link
Contributor Author

Additionally, it would be nice to move the following Handle definitions from Relude.Base to the new module Relude.Lifted.Handle for the sake of consistency

@rektrex No worries! Sorry if I wasn't clear. What I mean is that the Relude.Base module currently exports Handle, stdount and other functions from that list. But since we are introducing a separate Relude.Lifted.Handle module, it makes sense to reexport everything related to handles from this module instead, to keep the API and code more consistent. So these old things that we already reexport from Relude.Base should be reexported from Relude.Lifted.Handle instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reexport Reexport something new
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants