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 a splice of ShortByteString builder #664

Open
phadej opened this issue Feb 15, 2024 · 0 comments
Open

Add a splice of ShortByteString builder #664

phadej opened this issue Feb 15, 2024 · 0 comments

Comments

@phadej
Copy link
Contributor

phadej commented Feb 15, 2024

There is

shortByteString :: ShortByteString -> Builder

but sometimes we want to write only a part of a SBS, i.e.

partOfShortByteString :: Int {- ^ offset -} -> Int {- ^ length -} -> ShortByteString -> Builder

as there aren't efficient take and drop for SBS.

We can go one abstraction lower and provide:

byteArray :: ByteArray -> Builder
partOfByteArray :: nt {- ^ offset -} -> Int {- ^ length -} -> ByteArray -> Builder

as ByteArray is now "the" type, SBS is just a small wrapper around it.


If maintainers are happy with an idea, I'll make a PR.

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

No branches or pull requests

1 participant