Repository navigation
Fix CanonicalTerm map equality - #218
Merged
Merged
Conversation
Soupstraw
force-pushed
the
jj/map-equality
branch
2 times, most recently
from
October 30, 2026 10:28
42cf766 to
006ea48
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Existing map tests also pass with the old implementation and lack regression coverage for retaining distinct pairs with shared canonical keys, comparison behavior, and collapsing identical canonical pairs.
1 open issue
What changed in this PR
This PR updates canonical CBOR map equality to use sets of key-value pairs, matching the order-independent equality described in RFC 8949 §5.6.1.
Changes:
- Replace
CTMap’s map representation with a set of canonical pairs, removing the duplicate-key exception. - Bump the package version to
1.9.0.0and document the representation change.
| File | Description |
|---|---|
src/Codec/CBOR/Cuddle/CBOR/Canonical.hs |
Store canonical map entries as a set of pairs. |
cuddle.cabal |
Bump the version to 1.9.0.0. |
CHANGELOG.md |
Record the CTMap representation change. |
Review effort: Balanced
neilmayhew
approved these changes
Nov 3, 2026
neilmayhew
left a comment
Contributor
There was a problem hiding this comment.
LGTM, but I think Copilot's comment should be addressed, either in this PR or a subsequent one
Contributor
It looks like you're doing just that in #219 |
Soupstraw
force-pushed
the
jj/map-equality
branch
from
November 3, 2026 14:37
da141a0 to
b2bc500
Compare
Soupstraw
enabled auto-merge
November 3, 2026 14:39
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

This PR changes the
CTMapto use aSetinstead of aMap. This way the equality between maps works as described in RFC 8949 §5.6.1: