Skip to content

Remove HasField and pattern synonym#1401

Merged
parsonsmatt merged 2 commits into
masterfrom
matt/remove-cute-record-isntance
May 20, 2022
Merged

Remove HasField and pattern synonym#1401
parsonsmatt merged 2 commits into
masterfrom
matt/remove-cute-record-isntance

Conversation

@parsonsmatt

@parsonsmatt parsonsmatt commented May 20, 2022

Copy link
Copy Markdown
Collaborator

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)

@parsonsmatt parsonsmatt merged commit ebf1283 into master May 20, 2022
@parsonsmatt parsonsmatt deleted the matt/remove-cute-record-isntance branch May 21, 2022 00:49
@jaredramirez

Copy link
Copy Markdown

I'm not super familiar with this, but in the next release of GHC with this merged, could HasField be added back to persistent?

@parsonsmatt

Copy link
Copy Markdown
Collaborator Author

I think we'd need to gate it on the GHC version, and having a different definition of a foundational type based on which version of GHC you're using feels a little weird to me.

One thing we do at work is generate specific HasField instances for specific table types, so we have instance HasField "fieldName" (Entity Table) FieldType and instance HasField "fieldName" Table FieldType. This is part of our TemplateHaskell code that we apply to every table, so it works out pretty much the same right now.

@jaredramirez

jaredramirez commented Nov 7, 2024

Copy link
Copy Markdown

Cool, I finally got around to trying this out and it's working well. I put the TH code I wrote here: #1381 (comment) in case anyone in the future finds it useful!

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