haskell / haskell/bytestring

Add a splice of ShortByteString builder

Open
#664 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
301
Forks
144
Avg merge
7d 22h
Merged PRs (30d)
1

Description

There is

```haskell
shortByteString :: ShortByteString -> Builder
```

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

```haskell
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:

```haskell
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.