diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+Version 1.4.2
+---------------
+* Fixed compatibility with GHC 9 - PR by Felix Yan
+
 Version 1.4.1
 ---------------
 * Fixed the templates for multi-constructor records
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -207,6 +207,16 @@
 --             father=(Identity Nothing)})]}
 ~~~
 
+### Related works ###
+
+This package is one of several implementations of a pattern that is often called *Higher-Kinded Data*. Other examples
+include [hkd-lens](https://hackage.haskell.org/package/hkd-lens),
+[barbies](https://hackage.haskell.org/package/barbies), and [hiddledy](https://hackage.haskell.org/package/higgledy).
+
 Grammars are another use case that is almost, but not quite, completely unlike database records. See
 [grammatical-parsers](https://github.com/blamario/grampa/tree/master/grammatical-parsers) or
 [construct](https://hackage.haskell.org/package/construct) for examples.
+
+Both database records and grammars are flat structures. If your use case involves trees of rank-2 records, this
+package will probably not suffice. Consider using
+[deep-transformations](https://hackage.haskell.org/package/deep-transformations) instead.
diff --git a/rank2classes.cabal b/rank2classes.cabal
--- a/rank2classes.cabal
+++ b/rank2classes.cabal
@@ -1,5 +1,5 @@
 name:                rank2classes
-version:             1.4.1
+version:             1.4.2
 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
@@ -43,7 +43,7 @@
                        distributive < 0.7
 
   if flag(use-template-haskell)
-    build-depends: template-haskell >= 2.11 && < 2.17
+    build-depends: template-haskell >= 2.11 && < 2.18
     exposed-modules: Rank2.TH
 
 test-suite doctests
diff --git a/src/Rank2.hs b/src/Rank2.hs
--- a/src/Rank2.hs
+++ b/src/Rank2.hs
@@ -415,16 +415,16 @@
    (x1 Generics.:*: y1) <*> (x2 Generics.:*: y2) = (x1 <*> x2) Generics.:*: (y1 <*> y2)
 
 instance Applicative Empty where
-   pure = const Empty
+   pure _ = Empty
 
 instance Applicative Proxy where
-   pure = const Proxy
+   pure _ = Proxy
 
 instance (Semigroup x, Monoid x) => Applicative (Const x) where
-   pure = const (Const mempty)
+   pure _ = Const mempty
 
 instance Applicative (Only x) where
-   pure = Only
+   pure f = Only f
 
 instance Applicative g => Applicative (Identity g) where
    pure f = Identity (pure f)
diff --git a/src/Rank2/TH.hs b/src/Rank2/TH.hs
--- a/src/Rank2/TH.hs
+++ b/src/Rank2/TH.hs
@@ -7,6 +7,7 @@
 --
 -- or, if you're picky, you can invoke only 'deriveFunctor' and whichever other instances you need instead.
 
+{-# Language CPP #-}
 {-# Language TemplateHaskell #-}
 -- Adapted from https://wiki.haskell.org/A_practical_Template_Haskell_Tutorial
 
@@ -98,10 +99,17 @@
       NewtypeD _ nm tyVars kind c _ -> return (nm, tyVars, kind, [c])
       _ -> fail "deriveApply: tyCon may not be a type synonym."
  
+#if MIN_VERSION_template_haskell(2,17,0)
+   let (KindedTV tyVar () (AppT (AppT ArrowT StarT) StarT)) = last tyVars
+       instanceType           = conT cls `appT` foldl apply (conT tyConName) (init 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)) = last tyVars
        instanceType           = conT cls `appT` foldl apply (conT tyConName) (init tyVars)
        apply t (PlainTV name)    = appT t (varT name)
        apply t (KindedTV name _) = appT t (varT name)
+#endif
  
    putQ (Deriving tyConName tyVar)
    return (instanceType, cs)
diff --git a/test/MyModule.lhs b/test/MyModule.lhs
--- a/test/MyModule.lhs
+++ b/test/MyModule.lhs
@@ -207,6 +207,16 @@
 --             father=(Identity Nothing)})]}
 ~~~
 
+### Related works ###
+
+This package is one of several implementations of a pattern that is often called *Higher-Kinded Data*. Other examples
+include [hkd-lens](https://hackage.haskell.org/package/hkd-lens),
+[barbies](https://hackage.haskell.org/package/barbies), and [hiddledy](https://hackage.haskell.org/package/higgledy).
+
 Grammars are another use case that is almost, but not quite, completely unlike database records. See
 [grammatical-parsers](https://github.com/blamario/grampa/tree/master/grammatical-parsers) or
 [construct](https://hackage.haskell.org/package/construct) for examples.
+
+Both database records and grammars are flat structures. If your use case involves trees of rank-2 records, this
+package will probably not suffice. Consider using
+[deep-transformations](https://hackage.haskell.org/package/deep-transformations) instead.
