Skip to content

Add ToJSON/FromJSON instances for NonEmptyMap and NonEmptySet#5655

Merged
lehins merged 1 commit intomasterfrom
5650-nonemptymapset-need-tofromjson
Mar 21, 2026
Merged

Add ToJSON/FromJSON instances for NonEmptyMap and NonEmptySet#5655
lehins merged 1 commit intomasterfrom
5650-nonemptymapset-need-tofromjson

Conversation

@koslambrou
Copy link
Contributor

Description

Added the following tests:

  • JSON roundtrip property test
  • Unit test for trying to decode an empty object {} for the NonEmptyMap, and an empty list [] for the NonEmptySet. These scenarios are expected to fail with a specific error message.

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

@koslambrou koslambrou requested a review from a team as a code owner March 19, 2026 12:24
@koslambrou koslambrou linked an issue Mar 19, 2026 that may be closed by this pull request
@koslambrou koslambrou force-pushed the 5650-nonemptymapset-need-tofromjson branch from 76e7c05 to f74f04d Compare March 19, 2026 12:25
@koslambrou koslambrou force-pushed the 5650-nonemptymapset-need-tofromjson branch 2 times, most recently from 67c634c to 5ab2af3 Compare March 19, 2026 13:02
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

That's very nice. Thank you!
Needs a fouromlu, otherwise it is good to go

@koslambrou koslambrou force-pushed the 5650-nonemptymapset-need-tofromjson branch 2 times, most recently from 6078d88 to afa217e Compare March 20, 2026 21:56
@lehins lehins force-pushed the 5650-nonemptymapset-need-tofromjson branch from afa217e to 9ecde04 Compare March 21, 2026 02:21
@lehins lehins enabled auto-merge March 21, 2026 02:21
Added the following tests:

* JSON roundtrip property test
* Unit test for trying to decode an empty object `{}` for the
  `NonEmptyMap`, and an empty list `[]` for the `NonEmptySet`. These
  scenarios are expected to fail with a specific error message.
@koslambrou koslambrou force-pushed the 5650-nonemptymapset-need-tofromjson branch from 9ecde04 to a4ae5ae Compare March 21, 2026 16:50
@lehins lehins merged commit 36ca5dc into master Mar 21, 2026
119 of 120 checks passed
@lehins lehins deleted the 5650-nonemptymapset-need-tofromjson branch March 21, 2026 18:51
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.

NonEmpty[Map|Set] need [To|From]JSON

2 participants