haskell / haskell/bytestring

Add "Elem" type synonym

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

Description

I'd like to write some Backpack signatures which help smooth over the difference between Char8 and Word8 ByteStrings; however, in order to write the signature, I need to declare a new type "data Elem" to parametrize over the element type of the ByteString:

```
signature Data.ByteString where

data ByteString
data Elem

singleton :: Elem -> ByteString
```

In order for a module to implement this signature, it needs to export Elem. So this is very disappointing, which is the literal Data.ByteString from bytestring doesn't implement this signature.

Could we make it implement it? Yes, very easily: just add a type synonym `type Elem = Char/Word8` to each of the ByteString modules. Done. Can we? (It's an easy patch but I have to convince you guys to take it.)

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.