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

Equality on raw types #3662

Merged
merged 2 commits into from
Aug 23, 2023
Merged

Equality on raw types #3662

merged 2 commits into from
Aug 23, 2023

Conversation

lehins
Copy link
Contributor

@lehins lehins commented Aug 18, 2023

Description

This PR adds a EqRaw class that can be used to compare the Haskell type ignoring the underlying binary reopresentation for memoized times, regardless if they use MemoBytes or not. Default implementation, however, uses the MemoBytes representation, which will work for flat types based on MemoBytes, which is the majority of them. This approach simplifies the testing a bit.

@nc6 I took your suggestion of creating a separate class for this concept, it works out slightly nicer, because it will make tests less complex.

As a bonus this PR also adds ToExpr instances for some of the core types.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

@lehins lehins force-pushed the lehins/post-release-changelog-adjustments branch from a31ff25 to c386199 Compare August 18, 2023 13:17
@lehins lehins force-pushed the lehins/equality-on-raw-types branch from a19c892 to 276e841 Compare August 18, 2023 13:20
@nc6 nc6 self-requested a review August 18, 2023 13:31
@lehins lehins force-pushed the lehins/equality-on-raw-types branch from 276e841 to 6611836 Compare August 18, 2023 13:40
@lehins lehins marked this pull request as ready for review August 18, 2023 13:46
@lehins lehins force-pushed the lehins/post-release-changelog-adjustments branch from c386199 to bcc29d6 Compare August 18, 2023 15:45
@iohk-bors iohk-bors bot deleted the branch master August 18, 2023 19:20
@iohk-bors iohk-bors bot closed this Aug 18, 2023
@lehins lehins reopened this Aug 18, 2023
@lehins lehins changed the base branch from lehins/post-release-changelog-adjustments to master August 18, 2023 19:50
@lehins lehins force-pushed the lehins/equality-on-raw-types branch 3 times, most recently from 9fb7567 to 2637323 Compare August 22, 2023 20:20
@lehins lehins force-pushed the lehins/equality-on-raw-types branch from 2637323 to aeca1ff Compare August 23, 2023 11:43
teodanciu

This comment was marked as off-topic.

@lehins lehins added this to In progress in Conway via automation Aug 23, 2023
@lehins lehins moved this from In progress to In review in Conway Aug 23, 2023
Copy link
Contributor

@teodanciu teodanciu left a comment

Choose a reason for hiding this comment

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

Looks good to me

* Provide `EqRaw` instances for `TxCert`, `TxAuxData`, `TxWits`,
  `Script, `TxBody` and `Tx` for each era that defines one
* Require and provide `ToExpr` instances for `TxCert`, `TxAuxData`,
  `Script` and `TxBody`
* Simplify `specTxAuxDataUpgrade` test
@lehins lehins force-pushed the lehins/equality-on-raw-types branch from aeca1ff to b922b2c Compare August 23, 2023 13:20
@lehins lehins enabled auto-merge August 23, 2023 13:20
@lehins lehins merged commit 96947e7 into master Aug 23, 2023
11 of 12 checks passed
@iohk-bors iohk-bors bot deleted the lehins/equality-on-raw-types branch August 23, 2023 15:07
@Soupstraw Soupstraw moved this from In review to Done in Conway Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Conway
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants