-
Notifications
You must be signed in to change notification settings - Fork 13
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
Using ByteString internally? #19
Comments
I disagree here. Storing data bech32-encoded as bytestring would be silly. In the same way that storing base16-encoded data as bytestring is silly. When encoding data in a human-readable format like these, the main purpose is for displaying into user interfaces (might it be a command-line in the console, a web interface or a desktop client ...) Hence why |
Both arguments have merit. Haskell |
Perhaps I wasn't clear. I am not suggesting getting rid of the In my case, I'm dealing with many bech32 values which are stored as ASCII/UTF-8 bytes, as part of other data structures. Unfortunately, |
OK, I looked at how the aeson library does this, as an example.
We may wish to switch it around and have the "default" API be the |
Have you considered using
ByteString
internally, rather thanText
? Considering bech32 values are likely to be stored/serialized as plainByteString
s, seeing as they don't need any special encoding other than what plain old ASCII supports, having to convert back and forth betweenByteString
andText
for the purposes of parsing and rendering is wasteful.The text was updated successfully, but these errors were encountered: