diff --git a/Data/Generics/SYB/WithClass/Basics.hs b/Data/Generics/SYB/WithClass/Basics.hs
--- a/Data/Generics/SYB/WithClass/Basics.hs
+++ b/Data/Generics/SYB/WithClass/Basics.hs
@@ -18,7 +18,12 @@
 
 ) where
 
+#if MIN_VERSION_base(4,7,0)
+import Data.Typeable hiding (Proxy)
+#else
 import Data.Typeable
+#endif
+
 import Data.Generics.SYB.WithClass.Context
 
 #ifdef __HADDOCK__
diff --git a/Data/Generics/SYB/WithClass/Derive.hs b/Data/Generics/SYB/WithClass/Derive.hs
--- a/Data/Generics/SYB/WithClass/Derive.hs
+++ b/Data/Generics/SYB/WithClass/Derive.hs
@@ -39,7 +39,11 @@
                           Just m -> m ++ "."
                           Nothing -> ""
            typeString = moduleString ++ nameBase name
+#if MIN_VERSION_base(4,7,0)
+           body = [| mkTyConApp (mkTyCon3 $(litE $ stringL typeString)) [] |]
+#else
            body = [| mkTyConApp (mkTyCon $(litE $ stringL typeString)) [] |]
+#endif
            method = funD methodName [clause [wildP] (normalB body) []]
        in sequence [ instanceD (return [])
                                (conT className `appT` conT name)
diff --git a/Data/Generics/SYB/WithClass/Instances.hs b/Data/Generics/SYB/WithClass/Instances.hs
--- a/Data/Generics/SYB/WithClass/Instances.hs
+++ b/Data/Generics/SYB/WithClass/Instances.hs
@@ -1,6 +1,9 @@
 {-# LANGUAGE TemplateHaskell, FlexibleInstances,
              UndecidableInstances, OverlappingInstances, CPP,
              MultiParamTypeClasses #-}
+#if MIN_VERSION_base(4,7,0)
+{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-}
+#endif
 {-# OPTIONS_GHC -fno-warn-orphans #-}
 -- This is a module full of orphans, so don't warn about them
 
@@ -540,8 +543,12 @@
 
 
 -- INSTANCE_TYPEABLE0(DataType,dataTypeTc,"DataType")
+#if MIN_VERSION_base(4,7,0)
+deriving instance Typeable DataType
+#else
 #ifndef __HADDOCK__
 $(deriveTypeable [''DataType])
+#endif
 #endif
 
 instance Sat (ctx DataType) =>
diff --git a/syb-with-class.cabal b/syb-with-class.cabal
--- a/syb-with-class.cabal
+++ b/syb-with-class.cabal
@@ -1,5 +1,5 @@
 Name:               syb-with-class
-Version:            0.6.1.4
+Version:            0.6.1.5
 License:            BSD3
 License-file:       LICENSE
 Copyright:          2004 - 2008 The University of Glasgow, CWI,
@@ -25,7 +25,7 @@
   location: http://patch-tag.com/r/Saizan/syb-with-class/
 
 Library 
-    Build-Depends:      base >= 3 && < 5, template-haskell >= 2.4 && < 2.9, bytestring, array, containers
+    Build-Depends:      base >= 3 && < 5, template-haskell >= 2.4 && < 2.10, bytestring, array, containers
     Exposed-modules:
         Data.Generics.SYB.WithClass.Basics
         Data.Generics.SYB.WithClass.Context
