-
Notifications
You must be signed in to change notification settings - Fork 297
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 stock deriving strategy on generated Show instances for Uniques #1068
Conversation
ghc 8.8.3 with -Wmissing-deriving-strategies enabled emits a warning when compiling an Entity declaration with a Unique: mkPersist sqlSettings [persistUpperCase| Thing foo Text UniqueThingFoo foo deriving Show Eq |] <snip>/persistent/persistent-template/test/main.hs:44:1: warning: [-Wmissing-deriving-strategies] No deriving strategy specified. Did you want stock, newtype, or anyclass? | 44 | mkPersist sqlSettings [persistUpperCase| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... Specifying the stock strategy for the Unique's Show instance silences the warning: data instance Unique Thing = UniqueThingFoo Text - deriving Show + deriving stock Show
Current plan is to get rid of |
We can definitely get this done for the |
Adding |
This PR, for sure, |
hmmm, I think there's gotta be a better way to just apply that one commit to the old branch than setting the base branch, which tries to get everything in |
Are you trying to just pick |
(and by creative rebasing, I just mean dropping the top commit, and modifying the first one to not bump a version, so I guess not especially creative) |
I think I just want to cherry pick that commit onto the |
Cool, let me know if you need me to fiddle with anything. |
Don't forget Eq! +1 |
@parsonsmatt is this subsumed by #1127? If so, I'm fine to close this |
If you'd like to make a backported release with this patch, we can do that. But otherwise, yeah, since we're not generated Show instances anymore we don't need this. Sorry for not getting back to it 😅 |
Not a problem, we usually upgrade to the most recent version of persistent pretty quickly |
Hey we ran into this at Freckle trying to turn on
-Wmissing-deriving-strategies
withghc
8.8.3. Currently, we're seeing warnings when compilingEntity
declarations with aUnique
, e.g.:mkPersist sqlSettings [persistUpperCase| Thing foo Text UniqueThingFoo foo deriving Show Eq |]
⇒
Specifying the
stock
strategy for theUnique
's generatedShow
instance silences this warning:Before submitting your PR, check that you've:
After submitting your PR: