Skip to content

chore: Add comprehensive documentation for hGetChunk (#651)#655

Merged
Lysxia merged 4 commits intohaskell:masterfrom
mchav:update_io_comment
Sep 20, 2025
Merged

chore: Add comprehensive documentation for hGetChunk (#651)#655
Lysxia merged 4 commits intohaskell:masterfrom
mchav:update_io_comment

Conversation

@mchav
Copy link
Copy Markdown
Contributor

@mchav mchav commented Sep 19, 2025

Summary

This PR adds detailed Haddock documentation for the hGetChunk function to clarify its behavior regarding UTF-8 character boundaries and buffer limitations.

Motivation

The existing documentation didn't clearly explain why hGetChunk cannot guarantee reading an exact number of bytes. Users expecting byte-oriented behavior similar to ByteString.hGetSome may be confused by the character-oriented nature of Text operations.

Changes

  • Added comprehensive Haddock documentation covering:
    • UTF-8 character boundary handling (characters can be 1-4 bytes)
    • Internal buffer limitation (2048 characters via dEFAULT_CHAR_BUFFER_SIZE)
    • Clear distinction from byte-oriented operations
    • Clarifies the non-configurable buffer size limitation

@Lysxia
Copy link
Copy Markdown
Contributor

Lysxia commented Sep 19, 2025

Fine by me. @Bodigrim any thoughts?

@Bodigrim Bodigrim requested a review from Lysxia September 19, 2025 22:28
@Lysxia Lysxia merged commit 86b5590 into haskell:master Sep 20, 2025
25 of 26 checks passed
@Lysxia
Copy link
Copy Markdown
Contributor

Lysxia commented Sep 20, 2025

Thanks @mchav !

@Bodigrim Bodigrim linked an issue Sep 28, 2025 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Is hGetChunk still experimental

3 participants