diff --git a/safecopy.cabal b/safecopy.cabal
--- a/safecopy.cabal
+++ b/safecopy.cabal
@@ -7,7 +7,7 @@
 -- The package version. See the Haskell package versioning policy
 -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
 -- standards guiding when and how versions should be incremented.
-Version:             0.8.3
+Version:             0.8.4
 
 -- A short (one-line) description of the package.
 Synopsis:            Binary serialization with version control.
@@ -78,5 +78,5 @@
   Hs-Source-Dirs:      test/
   GHC-Options:         -Wall -threaded -rtsopts -with-rtsopts=-N
   Build-depends:       base, cereal, template-haskell, safecopy,
-                       containers, time, array, vector, lens,
-                       tasty, tasty-quickcheck, quickcheck-instances
+                       containers, time, array, vector, lens >= 4.7 && < 5.0,
+                       lens-action, tasty, tasty-quickcheck, quickcheck-instances
diff --git a/src/Data/SafeCopy/Derive.hs b/src/Data/SafeCopy/Derive.hs
--- a/src/Data/SafeCopy/Derive.hs
+++ b/src/Data/SafeCopy/Derive.hs
@@ -232,6 +232,12 @@
 forceTag HappstackData = True
 forceTag _             = False
 
+tyVarName :: TyVarBndr -> Name
+tyVarName (PlainTV n) = n
+#if MIN_VERSION_template_haskell(2,10,0)
+tyVarName (KindedTV n _) = n
+#endif
+
 internalDeriveSafeCopy :: DeriveType -> Version a -> Name -> Name -> Q [Dec]
 internalDeriveSafeCopy deriveType versionId kindName tyName = do
   info <- reify tyName
@@ -255,8 +261,13 @@
   where
     worker = worker' (conT tyName)
     worker' tyBase context tyvars cons =
-      let ty = foldl appT tyBase [ varT var | PlainTV var <- tyvars ]
-      in (:[]) <$> instanceD (cxt $ [classP ''SafeCopy [varT var] | PlainTV var <- tyvars] ++ map return context)
+      let ty = foldl appT tyBase [ varT $ tyVarName var | var <- tyvars ]
+#if MIN_VERSION_template_haskell(2,10,0)
+          safeCopyClass args = foldl appT (conT ''SafeCopy) args
+#else
+          safeCopyClass args = classP ''SafeCopy args
+#endif
+      in (:[]) <$> instanceD (cxt $ [safeCopyClass [varT $ tyVarName var] | var <- tyvars] ++ map return context)
                                        (conT ''SafeCopy `appT` ty)
                                        [ mkPutCopy deriveType cons
                                        , mkGetCopy deriveType (show tyName) cons
@@ -289,8 +300,13 @@
   where
     typeNameStr = unwords $ map show (tyName:tyIndex')
     worker' tyBase context tyvars cons =
-      let ty = foldl appT tyBase [ varT var | PlainTV var <- tyvars ]
-      in (:[]) <$> instanceD (cxt $ [classP ''SafeCopy [varT var] | PlainTV var <- tyvars] ++ map return context)
+      let ty = foldl appT tyBase [ varT $ tyVarName var | var <- tyvars ]
+#if MIN_VERSION_template_haskell(2,10,0)
+          safeCopyClass args = foldl appT (conT ''SafeCopy) args
+#else
+          safeCopyClass args = classP ''SafeCopy args
+#endif
+      in (:[]) <$> instanceD (cxt $ [safeCopyClass [varT $ tyVarName var] | var <- tyvars] ++ map return context)
                                        (conT ''SafeCopy `appT` ty)
                                        [ mkPutCopy deriveType cons
                                        , mkGetCopy deriveType typeNameStr cons
diff --git a/test/instances.hs b/test/instances.hs
--- a/test/instances.hs
+++ b/test/instances.hs
@@ -12,6 +12,7 @@
 
 import Control.Applicative
 import Control.Lens
+import Control.Lens.Action
 import Data.Array (Array)
 import Data.Array.Unboxed (UArray)
 import Data.Data.Lens
