Visitar URL original
Use toEncoding for toPersistValueJSON by matthewbauer · Pull Request #1541 · yesodweb/persistent · GitHub
Skip to content

Use toEncoding for toPersistValueJSON - #1541

Open
matthewbauer wants to merge 3 commits into
yesodweb:masterfrom
matthewbauer:use-to-encoding-for-toPersistValueJSON
Open

matthewbauer wants to merge 3 commits into
yesodweb:masterfrom
matthewbauer:use-to-encoding-for-toPersistValueJSON

Conversation

@matthewbauer

@matthewbauer matthewbauer commented Jul 12, 2024 •

Copy link
Copy Markdown

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.
Co-authored-by: Matt Parsons <parsonsmatt@gmail.com>
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