Skip to content
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

proposal: disambiguate binary data from text data #669

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Mar 21, 2024

Changelog

- description: |
    Introduce newtype to disambiguate binary data from text data
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  - improvement    # QoL changes e.g. refactoring
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Fixes #568

I couldn't find other usages of ProposalText for binary data, so I think this is all there is to do to fix 568

How to trust this PR

It is really harmless

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Self-reviewed the diff

@smelc smelc force-pushed the smelc/disambiguate-text-binary-in-proposal-newtype branch from 99edf47 to 717ce60 Compare March 21, 2024 15:10
@smelc smelc changed the title Introduce newtype to disambiguate binary data from text data proposal: disambiguate binary data from text data Mar 21, 2024
@@ -122,6 +124,10 @@ newtype ProposalUrl = ProposalUrl
{ unProposalUrl :: L.Url
} deriving (Eq, Show)

newtype ProposalBinary = ProposalBinary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's funny, neither ProposalText or ProposalBinary are used in reading file:

I guess the next step would be to make use of those newtypes. 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should be defined as type level tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should be defined as type level tags.

Done in #683

@smelc smelc force-pushed the smelc/disambiguate-text-binary-in-proposal-newtype branch from 717ce60 to e48024b Compare March 22, 2024 14:30
@smelc smelc enabled auto-merge March 22, 2024 14:30
@smelc smelc added this pull request to the merge queue Mar 22, 2024
Merged via the queue into main with commit 6dc843c Mar 22, 2024
17 checks passed
@smelc smelc deleted the smelc/disambiguate-text-binary-in-proposal-newtype branch March 22, 2024 14:47
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -122,6 +124,10 @@ newtype ProposalUrl = ProposalUrl
{ unProposalUrl :: L.Url
} deriving (Eq, Show)

newtype ProposalBinary = ProposalBinary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should be defined as type level tags.

@smelc smelc mentioned this pull request Mar 28, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove confusing usage(s) of ProposalText
3 participants