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

Don't derive Show for Unique #1127

Merged
merged 2 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions persistent-template/Database/Persist/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -614,17 +614,14 @@ uniqueTypeDec mps t =
(AppT (ConT ''Unique) (genericDataType mps (entityHaskell t) backendT))
Nothing
(map (mkUnique mps t) $ entityUniques t)
(derivClause $ entityUniques t)
[]
#else
DataInstD [] ''Unique
[genericDataType mps (entityHaskell t) backendT]
Nothing
(map (mkUnique mps t) $ entityUniques t)
(derivClause $ entityUniques t)
[]
#endif
where
derivClause [] = []
derivClause _ = [DerivClause Nothing [ConT ''Show]]

mkUnique :: MkPersistSettings -> EntityDef -> UniqueDef -> Con
mkUnique mps t (UniqueDef (HaskellName constr) _ fields attrs) =
Expand Down
6 changes: 6 additions & 0 deletions persistent/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
* `Loc` is now imported from `monad-logger` as opposed to `template-haskell`. Removes `template-haskell` as an explicit dependency.
* [#1114](https://github.com/yesodweb/persistent/pull/1114)
* Remove unnecessary deriving of `Typeable`.
* [#1127](https://github.com/yesodweb/persistent/pull/1127)
* Remove deriving of `Show` for uniques. Users that need a `Show` instance can put a standalone deriving instance:

```haskell
deriving stock instance Show (Unique User)
```

## 2.10.5.2

Expand Down