Skip to content

Commit

Permalink
Derive Generic instances for non-generic newtype keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Kempf committed Nov 26, 2019
1 parent d79385d commit 8dad9e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions persistent-template/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased changes

## 2.7.4

* Also derive `Generic` instances for non-generic newtype keys (https://github.com/yesodweb/persistent/pull/990

## 2.7.3

* Update module documentation for `Database.Persist.TH` to better describe the purpose of the module [#968](https://github.com/yesodweb/persistent/pull/968)
Expand Down
2 changes: 1 addition & 1 deletion persistent-template/Database/Persist/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ mkKeyTypeDec mps t = do
then do pfDec <- pfInstD
return (pfDec, [''Show, ''Read, ''Eq, ''Ord, ''Generic])
else do
let allInstances = [''Show, ''Read, ''Eq, ''Ord, ''PathPiece, ''ToHttpApiData, ''FromHttpApiData, ''PersistField, ''PersistFieldSql, ''ToJSON, ''FromJSON]
let allInstances = [''Show, ''Read, ''Eq, ''Ord, ''PathPiece, ''ToHttpApiData, ''FromHttpApiData, ''PersistField, ''PersistFieldSql, ''ToJSON, ''FromJSON, ''Generic]
if customKeyType
then return ([], allInstances)
else do
Expand Down
2 changes: 1 addition & 1 deletion persistent-template/persistent-template.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: persistent-template
version: 2.7.3
version: 2.7.4
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
Expand Down

0 comments on commit 8dad9e5

Please sign in to comment.