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

Fix withFileContents documentation (lazy IO strikes again) #10389

Conversation

9999years
Copy link
Collaborator

The documentation for Distribution.Utils.Generic.withFileContents is incorrect:

$ cabal repl Cabal-syntax
ghci> import Distribution.Utils.Generic
ghci> withFileContents "README.md" $ \contents -> pure ("foo" `isInfixOf` contents)
*** Exception: README.md: hGetContents: illegal operation (delayed read on closed handle)
  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

@9999years 9999years force-pushed the wiggles/fix-withfilecontents-comment branch from 17017d2 to 892ef46 Compare September 27, 2024 23:00
@9999years 9999years added the merge me Tell Mergify Bot to merge label Sep 27, 2024
Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

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

A little unit test may be a good idea, but in honesty, the lazy IO caveats will paper-cut people anyway...

@mergify mergify bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days labels Sep 28, 2024
The documentation for `Distribution.Utils.Generic.withFileContents` is incorrect:

    $ cabal repl Cabal-syntax
    ghci> import Distribution.Utils.Generic
    ghci> withFileContents "README.md" $ \contents -> pure ("foo" `isInfixOf` contents)
    *** Exception: README.md: hGetContents: illegal operation (delayed read on closed handle)
@9999years
Copy link
Collaborator Author

No rebase label to fix the mergify check

@mergify mergify bot merged commit 6d25218 into haskell:master Sep 30, 2024
47 checks passed
@9999years 9999years deleted the wiggles/fix-withfilecontents-comment branch September 30, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge merge+no rebase ready and waiting Mergify is waiting out the cooldown period
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants