diff --git a/persistent/ChangeLog.md b/persistent/ChangeLog.md index 955d05125..cc6657d8e 100644 --- a/persistent/ChangeLog.md +++ b/persistent/ChangeLog.md @@ -1,12 +1,21 @@ # Changelog for persistent -## (unreleased) +## 2.14.0.1 * [#1392](https://github.com/yesodweb/persistent/pull/1392) * Enhance `selectList` documentation with TypeApplications examples. * Clarify `selectSource` documentation wording. * [#1391](https://github.com/yesodweb/persistent/pull/1391) * Increasing quasi module test coverage, improve error assertions +* [#1401](https://github.com/yesodweb/persistent/pull/1401) + * Change `Entity` back into a regular record and drop the `HasField` + instance. This is technically a breaking change, but [the bug in GHC's + `COMPLETE` annotations](https://gitlab.haskell.org/ghc/ghc/-/issues/15681) + rendered a super common pattern a much more invasive breaking change than + anticipated. As a result, upgrading to `persistent-2.14` was untenable. + + If you *did* upgrade and this broke your codebase *again*, please let me + know and I can release another patch to shim it. ## 2.14.0.0 diff --git a/persistent/Database/Persist/Class/PersistEntity.hs b/persistent/Database/Persist/Class/PersistEntity.hs index d960245e2..f645ed048 100644 --- a/persistent/Database/Persist/Class/PersistEntity.hs +++ b/persistent/Database/Persist/Class/PersistEntity.hs @@ -311,12 +311,10 @@ data FilterValue typ where -- Entity backend b)@), then you must you use @SELECT ??, ?? -- WHERE ...@, and so on. data Entity record = - Entity' (Key record) record - -pattern Entity :: Key rec -> rec -> Entity rec -pattern Entity { entityKey, entityVal } = Entity' entityKey entityVal - -{-# COMPLETE Entity #-} + Entity + { entityKey :: Key record + , entityVal :: record + } deriving instance (Generic (Key record), Generic record) => Generic (Entity record) deriving instance (Eq (Key record), Eq record) => Eq (Entity record) @@ -324,16 +322,6 @@ deriving instance (Ord (Key record), Ord record) => Ord (Entity record) deriving instance (Show (Key record), Show record) => Show (Entity record) deriving instance (Read (Key record), Read record) => Read (Entity record) -instance - ( SymbolToField sym ent typ - , PersistEntity ent - ) - => - HasField sym (Entity ent) typ - where - getField ent = - getConstant ((fieldLens (symbolToField @sym @ent @typ)) Constant ent) - -- | Get list of values corresponding to given entity. entityValues :: PersistEntity record => Entity record -> [PersistValue] entityValues (Entity k record) = diff --git a/persistent/persistent.cabal b/persistent/persistent.cabal index b9acd8892..d400a95d1 100644 --- a/persistent/persistent.cabal +++ b/persistent/persistent.cabal @@ -1,5 +1,5 @@ name: persistent -version: 2.14.0.0 +version: 2.14.0.1 license: MIT license-file: LICENSE author: Michael Snoyman