You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
. It states it returns the bytes read, up to n. But that is the behavior of the underlying hGetBuf, not hGet. hGet itself returns a ByteString with length up to n.
I think it would also be ergonomic to call out with emphasis that near EOF the returned bytestring can be shorter. (On a quick skimming, I assumed that hGet would fail / return empty if not enough bytes are available, while hGetSome would return the partial bytes. But turns out the difference is rather in terms of blocking or not in case data is not yet available?)
Also the doc Like hGet, except that a shorter ByteStringmay be returned if there are not enough bytes immediately available to satisfy the whole request. on hGetSome adds to the confusion. Kind of implies to the unaware reader that hGet would always return non-shorter bytestring.
The text was updated successfully, but these errors were encountered:
Hello,
See
bytestring/Data/ByteString.hs
Line 1927 in 6641404
n
. But that is the behavior of the underlying hGetBuf, not hGet. hGet itself returns aByteString
with length up ton
.I think it would also be ergonomic to call out with emphasis that near EOF the returned bytestring can be shorter. (On a quick skimming, I assumed that
hGet
would fail / return empty if not enough bytes are available, whilehGetSome
would return the partial bytes. But turns out the difference is rather in terms of blocking or not in case data is not yet available?)Also the doc
Like hGet, except that a shorter ByteStringmay be returned if there are not enough bytes immediately available to satisfy the whole request.
onhGetSome
adds to the confusion. Kind of implies to the unaware reader thathGet
would always return non-shorter bytestring.The text was updated successfully, but these errors were encountered: