Skip to content

Add a splice of ShortByteString builder #664

Open

Description

@phadej

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions