src/Data/SafeCopy/Derive.hs:222:14: error:
• Expecting one more argument to ‘TyVarBndr’
Expected a type, but ‘TyVarBndr’ has kind ‘* -> *’
• In the type signature: tyVarName :: TyVarBndr -> Name
|
222 | tyVarName :: TyVarBndr -> Name
| ^^^^^^^^^
I used following patch
diff --git a/src/Data/SafeCopy/Derive.hs b/src/Data/SafeCopy/Derive.hs
index 34e29fc..30494c3 100644
--- a/src/Data/SafeCopy/Derive.hs
+++ b/src/Data/SafeCopy/Derive.hs
@@ -219,9 +219,15 @@ forceTag :: DeriveType -> Bool
forceTag HappstackData = True
forceTag _ = False
+#if MIN_VERSION_template_haskell(2,17,0)
+tyVarName :: TyVarBndr s -> Name
+tyVarName (PlainTV n _) = n
+tyVarName (KindedTV n _ _) = n
+#else
tyVarName :: TyVarBndr -> Name
tyVarName (PlainTV n) = n
tyVarName (KindedTV n _) = n
+#endif
internalDeriveSafeCopy :: DeriveType -> Version a -> Name -> Name -> Q [Dec]
internalDeriveSafeCopy deriveType versionId kindName tyName = do
diff --git a/test/generic.hs b/test/generic.hs
index b3eb6fb..d777328 100644
--- a/test/generic.hs
+++ b/test/generic.hs
@@ -217,9 +217,9 @@ t2 = (T2 'b')
t3 = (T3 'c')
t4 = T4 100 200 300
-$(deriveSafeCopy 3 'base ''T1)
$(deriveSafeCopy 4 'base ''T2)
$(deriveSafeCopy 5 'base ''T3)
+$(deriveSafeCopy 3 'base ''T1)
$(deriveSafeCopy 6 'base ''T4)
data T1G = T1G Char T2G T3G deriving (Generic, Show)
I used following patch