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

Use toEncoding for toPersistValueJSON #1541

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matthewbauer
Copy link

@matthewbauer matthewbauer commented Jul 12, 2024

This should give us a performance benefit for free. Instead of creating a bunch of intermediate values and serializing them, we can just go straight to serialization with toEncoding. No new constraints are needed because ToJSON provides a default toEncoding.

Before submitting your PR, check that you've:

  • Documented new APIs with Haddock markup
  • Added @since declarations to the Haddock
  • Ran stylish-haskell on any changed files.
  • Adhered to the code style (see the .editorconfig file for details)

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Bumped the version number if there isn't an (unreleased) on the Changelog
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

This should give us a performance benefit for free. Instead of
creating a bunch of intermediate values and serializing them, we can
just go straight to serialization with toEncoding. No new constraints
are needed because ToJSON provides a default toEncoding.
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.

2 participants