Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Request: Analog for hGetSome from ByteString #25

jhance opened this Issue Apr 8, 2012 · 0 comments


None yet
2 participants

jhance commented Apr 8, 2012

It would be nice to be able to, say, read a chunk of 4096 characters or so. This would be useful for conduits/enumerators/etc. It seems like readChunk from Data.Text.IO.Internal is nearly the same, if a nicer (ie, using Handle, not Handle__) version could be exported in Data.Text.IO.

Its currently abstracted because it seems like it is intended to be used only for lazy IO or for strict hGetContents, but it would be nice to support strict IO as well.

Currently the way to deal with this is to source over a bytestring and encode it with a conduit (or enumeratee) while being insensitive to the actual system locale. It would be nice to not do this.

Although being able to specify the chunk size isn't all that important for the enumerator/conduit usage (they could just use the default), it could potentially be useful, so taking this is input would be a nice bonus (and make it consistent with the ByteString API)

If this is implemented, naturally hGet would be nice as well.

I might work on this later myself, but if anyone has any pointers on how to do this efficiently that'd be nice.

@jhance jhance referenced this issue Apr 8, 2012


Add hGetChunk #26

@bos bos closed this Sep 9, 2012

@jhance jhance referenced this issue in snoyberg/conduit Oct 9, 2012


Adding Functionality to `Data.Conduit.Text` #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment