diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,14 @@
+# 0.16.0.0
+
+- Updated to work with GHC 9.2.x. In particular:
+  - The generated code now enables the `FlexibleContexts` extension
+    since it is no longer implied by `UndecidableInstances`
+  - The `IsPtr` type alias now includes an additional constraint,
+    which GHC seems to no longer be able to derive from the others.
+  - Internals have been updated to deal with a breaking change to
+    `template-haskell`.
+- Fixed an error building the documentation.
+
 # 0.15.0.0
 
 - There is now a per-connection limit on the total size of incoming
diff --git a/capnp.cabal b/capnp.cabal
--- a/capnp.cabal
+++ b/capnp.cabal
@@ -1,8 +1,8 @@
 cabal-version:            2.2
 name:                     capnp
-version:                  0.15.0.0
+version:                  0.16.0.0
 category:                 Data, Serialization, Network, Rpc
-copyright:                2016-2021 haskell-capnp contributors (see CONTRIBUTORS file).
+copyright:                2016-2022 haskell-capnp contributors (see CONTRIBUTORS file).
 author:                   Ian Denhardt
 maintainer:               ian@zenhack.net
 license:                  MIT
@@ -59,7 +59,7 @@
       , containers                        >= 0.5.9 && <0.7
       , data-default                      ^>= 0.7.1
       , exceptions                        ^>= 0.10.0
-      , ghc-prim                          >= 0.6.1 && <0.8
+      , ghc-prim                          >= 0.6.1 && <0.9
       , mtl                               ^>= 2.2.2
       , primitive                         >= 0.6.3 && <0.8
       , safe-exceptions                   ^>= 0.1.7
@@ -167,7 +167,7 @@
       , supervisors                       ^>= 0.2.1
       , lifetimes                         ^>= 0.1
       , pretty-show                       >= 1.9.5 && <1.11
-      , template-haskell                  >=2.16.0 && <2.18
+      , template-haskell                  ^>=2.18
 
 --------------------------------------------------------------------------------
 
diff --git a/cmd/capnpc-haskell/Trans/NewToHaskell.hs b/cmd/capnpc-haskell/Trans/NewToHaskell.hs
--- a/cmd/capnpc-haskell/Trans/NewToHaskell.hs
+++ b/cmd/capnpc-haskell/Trans/NewToHaskell.hs
@@ -53,6 +53,7 @@
             , "DeriveGeneric"
             , "DuplicateRecordFields"
             , "EmptyDataDeriving"
+            , "FlexibleContexts"
             , "FlexibleInstances"
             , "MultiParamTypeClasses"
             , "UndecidableInstances"
diff --git a/examples/gen/lib/Capnp/Gen/Calculator/New.hs b/examples/gen/lib/Capnp/Gen/Calculator/New.hs
--- a/examples/gen/lib/Capnp/Gen/Calculator/New.hs
+++ b/examples/gen/lib/Capnp/Gen/Calculator/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/examples/gen/lib/Capnp/Gen/Echo/New.hs b/examples/gen/lib/Capnp/Gen/Echo/New.hs
--- a/examples/gen/lib/Capnp/Gen/Echo/New.hs
+++ b/examples/gen/lib/Capnp/Gen/Echo/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/gen/lib/Capnp/Gen/Capnp/Compat/Json/New.hs b/gen/lib/Capnp/Gen/Capnp/Compat/Json/New.hs
--- a/gen/lib/Capnp/Gen/Capnp/Compat/Json/New.hs
+++ b/gen/lib/Capnp/Gen/Capnp/Compat/Json/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/gen/lib/Capnp/Gen/Capnp/Cxx/New.hs b/gen/lib/Capnp/Gen/Capnp/Cxx/New.hs
--- a/gen/lib/Capnp/Gen/Capnp/Cxx/New.hs
+++ b/gen/lib/Capnp/Gen/Capnp/Cxx/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/gen/lib/Capnp/Gen/Capnp/Persistent/New.hs b/gen/lib/Capnp/Gen/Capnp/Persistent/New.hs
--- a/gen/lib/Capnp/Gen/Capnp/Persistent/New.hs
+++ b/gen/lib/Capnp/Gen/Capnp/Persistent/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/gen/lib/Capnp/Gen/Capnp/Rpc/New.hs b/gen/lib/Capnp/Gen/Capnp/Rpc/New.hs
--- a/gen/lib/Capnp/Gen/Capnp/Rpc/New.hs
+++ b/gen/lib/Capnp/Gen/Capnp/Rpc/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/gen/lib/Capnp/Gen/Capnp/RpcTwoparty/New.hs b/gen/lib/Capnp/Gen/Capnp/RpcTwoparty/New.hs
--- a/gen/lib/Capnp/Gen/Capnp/RpcTwoparty/New.hs
+++ b/gen/lib/Capnp/Gen/Capnp/RpcTwoparty/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/gen/lib/Capnp/Gen/Capnp/Schema/New.hs b/gen/lib/Capnp/Gen/Capnp/Schema/New.hs
--- a/gen/lib/Capnp/Gen/Capnp/Schema/New.hs
+++ b/gen/lib/Capnp/Gen/Capnp/Schema/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/gen/lib/Capnp/Gen/Capnp/Stream/New.hs b/gen/lib/Capnp/Gen/Capnp/Stream/New.hs
--- a/gen/lib/Capnp/Gen/Capnp/Stream/New.hs
+++ b/gen/lib/Capnp/Gen/Capnp/Stream/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/gen/tests/Capnp/Gen/Aircraft/New.hs b/gen/tests/Capnp/Gen/Aircraft/New.hs
--- a/gen/tests/Capnp/Gen/Aircraft/New.hs
+++ b/gen/tests/Capnp/Gen/Aircraft/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/gen/tests/Capnp/Gen/Generics/New.hs b/gen/tests/Capnp/Gen/Generics/New.hs
--- a/gen/tests/Capnp/Gen/Generics/New.hs
+++ b/gen/tests/Capnp/Gen/Generics/New.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE EmptyDataDeriving #-}
+{-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE UndecidableInstances #-}
diff --git a/lib/Capnp/Repr.hs b/lib/Capnp/Repr.hs
--- a/lib/Capnp/Repr.hs
+++ b/lib/Capnp/Repr.hs
@@ -256,8 +256,14 @@
 -- | Constraint that @a@ is a capability type.
 type IsCap a = ReprFor a ~ 'Ptr ('Just 'Cap)
 
+
 -- | Constraint that @a@ is a pointer type.
 type IsPtr a =
     ( ReprFor a ~ 'Ptr (PtrReprFor (ReprFor a))
+    -- N.B. prior to ghc 9.2.x, this next constraint wasn't necessary,
+    -- because it could be inferred from the first. I(zenhack) don't
+    -- fully understand what changed, but some call sites need this
+    -- extra help now...
+    , Untyped (ReprFor a) ~ UntypedPtr (PtrReprFor (ReprFor a))
     , IsPtrRepr (PtrReprFor (ReprFor a))
     )
diff --git a/lib/Capnp/Rpc/Untyped.hs b/lib/Capnp/Rpc/Untyped.hs
--- a/lib/Capnp/Rpc/Untyped.hs
+++ b/lib/Capnp/Rpc/Untyped.hs
@@ -1982,8 +1982,8 @@
         ( Nothing, RemoteDest _ ) ->
             -- If it resolves to a null client, then we can't send a disembargo.
             -- Note that this may result in futrther calls throwing exceptions
-            -- *before* the outstanding calls, which is a bit weird. But all
-            -- calls with throw at some point, so it's probably fine.
+            -- /before/ the outstanding calls, which is a bit weird. But all
+            -- calls will throw at some point, so it's probably fine.
             resolveNow
 
         -- Local promises never need embargos; we can just forward:
diff --git a/lib/Capnp/Untyped.hs b/lib/Capnp/Untyped.hs
--- a/lib/Capnp/Untyped.hs
+++ b/lib/Capnp/Untyped.hs
@@ -1142,6 +1142,7 @@
 
 -- | Return a prefix of the list, of the given length.
 {-# INLINABLE take #-}
+take :: (ListItem r, MonadThrow m) => Int -> ListOf r mut -> m (ListOf r mut)
 take count list
     | length list < count =
         throwM E.BoundsError { E.index = count, E.maxIndex = length list - 1 }
@@ -1532,7 +1533,7 @@
     let mkIsListPtrRepr (r, listC, str) =
             [d| instance IsListPtrRepr $r where
                     rToList = $(pure $ TH.ConE listC)
-                    rFromList $(pure $ TH.ConP listC [TH.VarP (TH.mkName "l")]) = pure l
+                    rFromList $(pure $ TH.ConP listC [] [TH.VarP (TH.mkName "l")]) = pure l
                     rFromList _ = expected $(pure $ TH.LitE $ TH.StringL $ "pointer to " ++ str)
                     rFromListMsg = messageDefault @(Untyped ('Ptr ('Just ('List ('Just $r)))))
             |]
diff --git a/tests/Module/Capnp/Rpc.hs b/tests/Module/Capnp/Rpc.hs
--- a/tests/Module/Capnp/Rpc.hs
+++ b/tests/Module/Capnp/Rpc.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE DataKinds             #-}
 {-# LANGUAGE DuplicateRecordFields #-}
 {-# LANGUAGE FlexibleContexts      #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
@@ -52,6 +53,7 @@
     , parsedToMsg
     , waitPipeline
     )
+import qualified Capnp.Repr as R
 import Capnp.Rpc.Errors (eFailed)
 
 import Capnp.Gen.Aircraft.New  hiding (Left, Right)
@@ -486,7 +488,9 @@
     race_ runServer runClient
 
 expectException
-    :: (IsCap c, TypeParam a, Parse a pa, Show pa)
+    :: ( IsCap c, TypeParam a, Parse a pa, Show pa
+       , R.ReprFor a ~ 'R.Ptr pr
+       )
     => (Client c -> IO (Pipeline a)) -> Parsed Exception -> Client c -> IO ()
 expectException callFn wantExn cap = do
     ret <- try $ callFn cap >>= waitPipeline
