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

Add lifted handle functions #323

Merged
merged 7 commits into from
Sep 30, 2020

Conversation

rektrex
Copy link
Collaborator

@rektrex rektrex commented Aug 14, 2020

Resolves #314

Checklist:

HLint

  • I've changed the exposed interface (add new reexports, remove reexports, rename reexported things, etc.).
    • I've updated hlint.dhall accordingly to my changes (add new rules for the new imports, remove old ones, when they are outdated, etc.).
    • I've generated the new .hlint.yaml file (see this instructions).

General

  • I've updated the CHANGELOG with the short description of my latest changes.
  • All new and existing tests pass.
  • I keep the code style used in the files I've changed (see style-guide for more details).
  • I've used the stylish-haskell file.
  • My change requires the documentation updates.
    • I've updated the documentation accordingly.
  • I've added the [ci skip] text to the docs-only related commit's name.

Copy link
Contributor

@hint-man hint-man bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no place for me here... I will choose the truth I like.

@chshersh chshersh mentioned this pull request Aug 21, 2020
10 tasks
@chshersh chshersh added the reexport Reexport something new label Aug 21, 2020
Copy link
Member

@vrom911 vrom911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat work!
Thanks for the Inline and specialise pragmas everywhere! 👍🏼

@@ -95,3 +98,6 @@ Lifted reexports from "Data.IORef" module.
{- $terminal
Lifted functions to work with stdin and stdout.
-}
{- $handle
Lifted functions to work with IO Handles.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Lifted functions to work with IO Handles.
Lifted functions to work with 'Relude.Base.IO' 'Handle's.

, hIsEOF
, hSetBuffering
, hGetBuffering
, module System.IO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to inline this export explicitly.
It is better for documentation and you can see straight away what is exported from this module without going into sources 🙂

Copy link
Contributor

@chshersh chshersh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! A few suggestions from my side as well 🙂

src/Relude/Lifted/Handle.hs Show resolved Hide resolved
Stability: Stable
Portability: Portable

Lifted functions to with IO Handles.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Lifted functions to with IO Handles.
Lifted functions to work with 'IO' 'Handle's.

@since 0.8.0.0
-}
hSetBuffering :: MonadIO m => IO.Handle -> IO.BufferMode -> m ()
hSetBuffering = (liftIO .) . IO.hSetBuffering
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer a less point-free implementation

Suggested change
hSetBuffering = (liftIO .) . IO.hSetBuffering
hSetBuffering h = liftIO . IO.hSetBuffering h

@chshersh
Copy link
Contributor

Hi @rektrex! I've noticed that there are still a few documentation suggestions left unfixed. Would you like to apply them as well, so we can proceed with this PR? Looking forward to having these changes merged after everything is done 🙂

.hlint.yaml Outdated Show resolved Hide resolved
Co-authored-by: Veronika Romashkina <vrom911@gmail.com>
@rektrex
Copy link
Collaborator Author

rektrex commented Sep 21, 2020

Sorry, forgot to add [ci skip].

Copy link
Member

@vrom911 vrom911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank you so much ✨

Copy link
Contributor

@chshersh chshersh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 💪

@chshersh chshersh merged commit 61d85ea into kowainik:master Sep 30, 2020
@chshersh
Copy link
Contributor

@rektrex Sorry for the delay in merge. Stack on Travis didn't work around that time, so the CI was failing. I've rerun the Travis CI, and it passed! 💚 Thanks again for the PR 👍

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 this pull request may close these issues.

Reexport 'hFlush'
3 participants