rank2classes 1.5 → 1.5.1
raw patch · 3 files changed
+14/−1 lines, 3 filesdep ~template-haskell
Dependency ranges changed: template-haskell
Files
- CHANGELOG.md +5/−0
- rank2classes.cabal +1/−1
- src/Rank2/TH.hs +8/−0
CHANGELOG.md view
@@ -1,3 +1,8 @@+Version 1.5.1+---------------+* Fixed the `Rank2.TH` templates on GHC < 9.2 with no `OverloadedRecordDot` support to revert to their+ 1.4.6 behaviour.+ Version 1.5 --------------- * The `Rank2.TH` templates have changed, are now applicable with `DuplicateRecordFields` provided that
rank2classes.cabal view
@@ -1,5 +1,5 @@ name: rank2classes-version: 1.5+version: 1.5.1 synopsis: standard type constructor class hierarchy, only with methods of rank 2 types description: A mirror image of the standard type constructor class hierarchy rooted in 'Functor', except with methods of rank 2
src/Rank2/TH.hs view
@@ -579,20 +579,28 @@ projectField :: Name -> Q Exp projectField field = do+#if MIN_VERSION_template_haskell(2,19,0) dotty <- TH.isExtEnabled TH.OverloadedRecordDot if dotty then TH.projectionE (pure $ TH.nameBase field) else varE field+#else+ varE field+#endif getFieldOf :: Name -> Name -> Q Exp getFieldOf = getFieldOfE . varE getFieldOfE :: Q Exp -> Name -> Q Exp getFieldOfE record field = do+#if MIN_VERSION_template_haskell(2,19,0) dotty <- TH.isExtEnabled TH.OverloadedRecordDot if dotty then TH.getFieldE record (TH.nameBase field) else appE (varE field) record+#else+ appE (varE field) record+#endif constrain :: Name -> Type -> [Type] constrain _ ConT{} = []