diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
 # Revision history for deep-transformations
 
+## 0.2.3 -- 2024-05-18
+
+* Bumped the upper bound of the template-haskell dependency
+* Generalized the TH generation code
+* Fixed the loopy superclass constraints in instance declarations
+
 ## 0.2.2 -- 2023-06-25
 
 * Updated for GHC 9.8.1 and TH 2.22
diff --git a/deep-transformations.cabal b/deep-transformations.cabal
--- a/deep-transformations.cabal
+++ b/deep-transformations.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                deep-transformations
-version:             0.2.2
+version:             0.2.3
 synopsis:            Deep natural and unnatural tree transformations, including attribute grammars
 description:
 
@@ -45,7 +45,7 @@
   ghc-options:         -Wall
   build-depends:        base >= 4.11 && < 5, rank2classes >= 1.4.1 && < 1.6,
                         transformers >= 0.5 && < 0.7,
-                        template-haskell >= 2.11 && < 2.22, generic-lens >= 1.2 && < 2.3
+                        template-haskell >= 2.11 && < 2.23, generic-lens >= 1.2 && < 2.3
   default-language:     Haskell2010
 
 test-suite doctests
diff --git a/src/Transformation/AG/Dimorphic.hs b/src/Transformation/AG/Dimorphic.hs
--- a/src/Transformation/AG/Dimorphic.hs
+++ b/src/Transformation/AG/Dimorphic.hs
@@ -63,12 +63,12 @@
    {-# INLINE ($) #-}
 
 instance (Transformation (Auto t), Domain (Auto t) ~ f, Functor f, Codomain (Auto t) ~ Semantics a b,
-          Deep.Functor (Auto t) g, Auto t `At` g (Semantics a b) (Semantics a b)) =>
+          Rank2.Functor (g f), Deep.Functor (Auto t) g, Auto t `At` g (Semantics a b) (Semantics a b)) =>
          Full.Functor (Auto t) g where
    (<$>) = Full.mapUpDefault
 
 instance (Transformation (Keep t), Domain (Keep t) ~ f, Functor f, Codomain (Keep t) ~ PreservingSemantics f a b,
-          Functor f, Deep.Functor (Keep t) g,
+          Rank2.Functor (g f), Deep.Functor (Keep t) g,
           Keep t `At` g (PreservingSemantics f a b) (PreservingSemantics f a b)) =>
          Full.Functor (Keep t) g where
    (<$>) = Full.mapUpDefault
@@ -142,13 +142,16 @@
 
 data Feeder a b (f :: Type -> Type) = Feeder
 
+type FeederDomain a b f = Compose ((->) a) (Compose ((,) (Atts a b)) f)
+
 instance Transformation (Feeder a b f) where
-   type Domain (Feeder a b f) = Compose ((->) a) (Compose ((,) (Atts a b)) f)
-   type Codomain (Feeder a b f) = Compose ((->) a) (Compose ((,) (Atts a b)) f)
+   type Domain (Feeder a b f) = FeederDomain a b f
+   type Codomain (Feeder a b f) = FeederDomain a b f
 
 instance Transformation.At (Feeder a b f) g where
    Feeder $ x = x
 
-instance (Traversable f, Deep.Traversable (Feeder a b f) g) => Full.Traversable (Feeder a b f) g where
+instance (Traversable f, Rank2.Traversable (g (FeederDomain a b f)), Deep.Traversable (Feeder a b f) g) =>
+         Full.Traversable (Feeder a b f) g where
    traverse t x inheritance = Compose (atts{inh= inheritance}, traverse (Deep.traverse t) y (inh atts))
       where Compose (atts, y) = getCompose x inheritance
diff --git a/src/Transformation/AG/Generics.hs b/src/Transformation/AG/Generics.hs
--- a/src/Transformation/AG/Generics.hs
+++ b/src/Transformation/AG/Generics.hs
@@ -26,7 +26,6 @@
 import Data.Kind (Type)
 import Data.Generics.Product.Subtype (Subtype(upcast))
 import Data.Proxy (Proxy(..))
-import Data.Semigroup (Semigroup(..))
 import GHC.Generics
 import GHC.Records
 import GHC.TypeLits (Symbol, ErrorMessage (Text), TypeError)
@@ -72,12 +71,12 @@
    {-# INLINE ($) #-}
 
 instance (Transformation (Auto t), Domain (Auto t) ~ f, Functor f, Codomain (Auto t) ~ Semantics (Auto t),
-          Deep.Functor (Auto t) g, Auto t `At` g (Semantics (Auto t)) (Semantics (Auto t))) =>
+          Rank2.Functor (g f), Deep.Functor (Auto t) g, Auto t `At` g (Semantics (Auto t)) (Semantics (Auto t))) =>
          Full.Functor (Auto t) g where
    (<$>) = Full.mapUpDefault
 
 instance (Transformation (Keep t), Domain (Keep t) ~ f, Functor f, Codomain (Keep t) ~ PreservingSemantics (Keep t) f,
-          Functor f, Deep.Functor (Keep t) g,
+          Functor f, Rank2.Functor (g f), Deep.Functor (Keep t) g,
           Keep t `At` g (PreservingSemantics (Keep t) f) (PreservingSemantics (Keep t) f)) =>
          Full.Functor (Keep t) g where
    (<$>) = Full.mapUpDefault
diff --git a/src/Transformation/AG/Monomorphic.hs b/src/Transformation/AG/Monomorphic.hs
--- a/src/Transformation/AG/Monomorphic.hs
+++ b/src/Transformation/AG/Monomorphic.hs
@@ -63,12 +63,12 @@
    {-# INLINE ($) #-}
 
 instance (Transformation (Auto t), Domain (Auto t) ~ f, Functor f, Codomain (Auto t) ~ Semantics a,
-          Deep.Functor (Auto t) g, Auto t `At` g (Semantics a) (Semantics a)) =>
+          Rank2.Functor (g f), Deep.Functor (Auto t) g, Auto t `At` g (Semantics a) (Semantics a)) =>
          Full.Functor (Auto t) g where
    (<$>) = Full.mapUpDefault
 
 instance (Transformation (Keep t), Domain (Keep t) ~ f, Functor f, Codomain (Keep t) ~ PreservingSemantics f a,
-          Functor f, Deep.Functor (Keep t) g,
+          Functor f, Rank2.Functor (g f), Deep.Functor (Keep t) g,
           Keep t `At` g (PreservingSemantics f a) (PreservingSemantics f a)) =>
          Full.Functor (Keep t) g where
    (<$>) = Full.mapUpDefault
diff --git a/src/Transformation/Rank2.hs b/src/Transformation/Rank2.hs
--- a/src/Transformation/Rank2.hs
+++ b/src/Transformation/Rank2.hs
@@ -7,6 +7,7 @@
 
 import Data.Functor.Compose (Compose(Compose))
 import Data.Functor.Const (Const(Const))
+import qualified Rank2
 import           Transformation (Transformation, Domain, Codomain)
 import qualified Transformation
 import qualified Transformation.Deep as Deep
@@ -52,5 +53,5 @@
 instance Transformation.At (Traversal p q m) x where
    ($) (Traversal f) = Compose . f
 
-instance (Deep.Functor (Map p q) g, Functor p) => Full.Functor (Map p q) g where
+instance (Rank2.Functor (g p), Deep.Functor (Map p q) g, Functor p) => Full.Functor (Map p q) g where
   (<$>) = Full.mapUpDefault
diff --git a/src/Transformation/Shallow/TH.hs b/src/Transformation/Shallow/TH.hs
--- a/src/Transformation/Shallow/TH.hs
+++ b/src/Transformation/Shallow/TH.hs
@@ -105,12 +105,12 @@
    tyVars' <- traverse reifyTVKindSynonyms tyVars
 
 #if MIN_VERSION_template_haskell(2,17,0)
-   let (KindedTV tyVar _ (AppT (AppT ArrowT StarT) StarT) : _) = reverse tyVars'
+   let (KindedTV tyVar _ (AppT (AppT ArrowT _) StarT) : _) = reverse tyVars'
        instanceType           = foldl apply (conT tyConName) (reverse $ drop 1 $ reverse tyVars')
        apply t (PlainTV name _)    = appT t (varT name)
        apply t (KindedTV name _ _) = appT t (varT name)
 #else
-   let (KindedTV tyVar  (AppT (AppT ArrowT StarT) StarT) : _) = reverse tyVars'
+   let (KindedTV tyVar  (AppT (AppT ArrowT _) StarT) : _) = reverse tyVars'
        instanceType           = foldl apply (conT tyConName) (reverse $ drop 1 $ reverse tyVars')
        apply t (PlainTV name)    = appT t (varT name)
        apply t (KindedTV name _) = appT t (varT name)
