-
Notifications
You must be signed in to change notification settings - Fork 1
Add structured types for bech32 encoding result #40
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
Merged
ProofOfKeags
merged 3 commits into
haskell-bitcoin:master
from
tochicool:bech32-structured-results
Nov 4, 2022
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we wanna make this
!Text
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a good case to be made for making this field lazy. After all consumers may check one of the error fields and decide to throw away the encoding. Maybe we can reduce indirection for
bech32Encode
by changing the last line toThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the reason for wanting
seq
there to reduce some unwanted laziness? I think the following would no longer terminate ifencodeResult
was somehow not total, where it would have previously otherwise, ie:Happy to go with that if we're all convinced that
encodeResult
is always total. I'm also fine with keeping existing definitions for bech32Encode / bech32Decode if we're worried about the extra overhead caused by the lazy data types.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a misguided suggestion. Let's leave things as is. FWIW that making
encodeResult
a strict field has the same effect with respect to makingbech32Encode
diverge.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion was rooted in the perhaps false assumption that we could predict that the overwhelming majority of the time we would want to read the decoded result out. If that isn't the case then we can leave it as is.