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

Simplify implementation of ToJSON1 of ListMap #4188

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Simplify implementation of ToJSON1 of ListMap #4188

merged 2 commits into from
Mar 11, 2024

Conversation

palas
Copy link
Contributor

@palas palas commented Mar 8, 2024

Description

I was investigating a memory issue and found this in the process, which turned out not to be the issue. But still I think it is a good simplification, and is probably more efficient in general. I did some experiments in ghci and map seemed much more efficient than foldr.

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

@palas palas added the simplification A nice to have improvement that simplifies the implementation label Mar 8, 2024
@palas palas self-assigned this Mar 8, 2024
@palas palas requested a review from Soupstraw March 8, 2024 17:53
@palas palas marked this pull request as ready for review March 8, 2024 17:54
@palas palas enabled auto-merge (squash) March 8, 2024 17:55
Copy link
Contributor

@Soupstraw Soupstraw left a comment

Choose a reason for hiding this comment

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

LGTM, good catch!

@palas palas merged commit 1ab6922 into master Mar 11, 2024
91 of 93 checks passed
@palas palas deleted the simplification branch March 11, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
simplification A nice to have improvement that simplifies the implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants