diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,7 +1,12 @@
 # Changelog for ghc-lib-parser-ex
 
+# 9.6.0.1 released
+- Add `&` to `baseFixities`
+- Add support for ghc-9.8 series: `GH_9_8`
+- New functions `isLetStmt` and `isDo`
+
 # 9.6.0.0 released
-- Add support for ghc-9.6 series: `GHCLIB_API_906`
+- Add support for ghc-9.6 series: `GHC_9_6`
 
 ## 0.20221201 released
 - Update to `ghc-lib-parser-0.20221201`
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@
 ```
 Run `stack runhaskell --package extra --package optparse-applicative CI.hs -- --help` for more options.
 
-To run [`hlint`](https://github.com/ndmitchell/hlint) on this repository, `hlint --cpp-include cbits --cpp-define GHCLIB_API_XXX .` (where `XXX` at this time is one of `808`, `810`, `900`, `902`, `904`, `906` or `HEAD`).
+To run [`hlint`](https://github.com/ndmitchell/hlint) on this repository, `hlint --cpp-include cbits --cpp-define GHC_XXXX .` (where `XXXX` at this time is one of `8_8`, `8_10`, `9_0`, `9_2`, `9_4`, `9_6`, `9_8` or `9_10`).
 
 ## Releasing `ghc-lib-parser-ex` (notes for maintainers)
 
diff --git a/cbits/ghclib_api.h b/cbits/ghclib_api.h
--- a/cbits/ghclib_api.h
+++ b/cbits/ghclib_api.h
@@ -1,51 +1,56 @@
 /*
-Copyright (c) 2020, 2021 Shayne Fletcher. All rights reserved.
+Copyright (c) 2020 - 2023 Shayne Fletcher. All rights reserved.
 SPDX-License-Identifier: BSD-3-Clause.
- */
+*/
 
 #if !defined(GHCLIB_API_H)
 #  define GHCLIB_API_H
 
-#  if !(defined (GHCLIB_API_HEAD)   \
-     || defined (GHCLIB_API_906)    \
-     || defined (GHCLIB_API_904)    \
-     || defined (GHCLIB_API_902)    \
-     || defined (GHCLIB_API_900)    \
-     || defined (GHCLIB_API_810)    \
-     || defined (GHCLIB_API_808))
-#    if defined(MIN_VERSION_ghc_lib_parser)
-#       if !MIN_VERSION_ghc_lib_parser( 1,  0,  0)
-#         define GHCLIB_API_HEAD
-#       elif MIN_VERSION_ghc_lib_parser(9,  6,  0)
-#         define GHCLIB_API_906
-#       elif MIN_VERSION_ghc_lib_parser(9,  4,  0)
-#         define GHCLIB_API_904
-#       elif MIN_VERSION_ghc_lib_parser(9,  2,  0)
-#         define GHCLIB_API_902
-#       elif MIN_VERSION_ghc_lib_parser(9,  0,  0)
-#         define GHCLIB_API_900
-#       elif MIN_VERSION_ghc_lib_parser(8, 10,  0)
-#         define GHCLIB_API_810
-#       elif MIN_VERSION_ghc_lib_parser(8,  8,  0)
-#         define GHCLIB_API_808
+#  if !(defined (GHC_9_10) \
+     || defined (GHC_9_8)  \
+     || defined (GHC_9_6)  \
+     || defined (GHC_9_4)  \
+     || defined (GHC_9_2)  \
+     || defined (GHC_9_0)  \
+     || defined (GHC_8_10) \
+     || defined (GHC_8_8))
+#    if defined (MIN_VERSION_ghc_lib_parser)
+#       if !MIN_VERSION_ghc_lib_parser ( 1,  0,  0)
+#         define GHC_9_10
+#       elif MIN_VERSION_ghc_lib_parser (9,  8,  0)
+#         define GHC_9_8
+#       elif MIN_VERSION_ghc_lib_parser (9,  6,  0)
+#         define GHC_9_6
+#       elif MIN_VERSION_ghc_lib_parser (9,  4,  0)
+#         define GHC_9_4
+#       elif MIN_VERSION_ghc_lib_parser (9,  2,  0)
+#         define GHC_9_2
+#       elif MIN_VERSION_ghc_lib_parser (9,  0,  0)
+#         define GHC_9_0
+#       elif MIN_VERSION_ghc_lib_parser (8, 10,  0)
+#         define GHC_8_10
+#       elif MIN_VERSION_ghc_lib_parser (8,  8,  0)
+#         define GHC_8_8
 #       else
 #         error Unsupported GHC API version
 #      endif
 #    else
-#      if __GLASGOW_HASKELL__   == 907
-#        define GHCLIB_API_HEAD
+#      if __GLASGOW_HASKELL__   == 909
+#        define GHC_9_10
+#      elif __GLASGOW_HASKELL__ == 908
+#        define GHC_9_8
 #      elif __GLASGOW_HASKELL__ == 906
-#        define GHCLIB_API_906
+#        define GHC_9_6
 #      elif __GLASGOW_HASKELL__ == 904
-#        define GHCLIB_API_904
+#        define GHC_9_4
 #      elif __GLASGOW_HASKELL__ == 902
-#        define GHCLIB_API_902
+#        define GHC_9_2
 #      elif __GLASGOW_HASKELL__ == 900
-#        define GHCLIB_API_900
+#        define GHC_9_0
 #      elif __GLASGOW_HASKELL__ == 810
-#        define GHCLIB_API_810
+#        define GHC_8_10
 #      elif __GLASGOW_HASKELL__ == 808
-#        define GHCLIB_API_808
+#        define GHC_8_8
 #      else
 #        error Unsupported GHC API version
 #      endif
diff --git a/ghc-lib-parser-ex.cabal b/ghc-lib-parser-ex.cabal
--- a/ghc-lib-parser-ex.cabal
+++ b/ghc-lib-parser-ex.cabal
@@ -1,6 +1,6 @@
 cabal-version:  1.18
 name:           ghc-lib-parser-ex
-version:        9.6.0.0
+version:        9.6.0.1
 description:    Please see the README on GitHub at <https://github.com/shayne-fletcher/ghc-lib-parser-ex#readme>
 homepage:       https://github.com/shayne-fletcher/ghc-lib-parser-ex#readme
 bug-reports:    https://github.com/shayne-fletcher/ghc-lib-parser-ex/issues
diff --git a/src/Language/Haskell/GhclibParserEx/Dump.hs b/src/Language/Haskell/GhclibParserEx/Dump.hs
--- a/src/Language/Haskell/GhclibParserEx/Dump.hs
+++ b/src/Language/Haskell/GhclibParserEx/Dump.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 {-
 (c) The University of Glasgow 2006
@@ -13,14 +13,14 @@
 module Language.Haskell.GhclibParserEx.Dump(
     showAstData
   , BlankSrcSpan(..)
-#if defined(GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
   , BlankEpAnnotations(..)
 #endif
 ) where
 
 #if !defined(MIN_VERSION_ghc_lib_parser)
 -- Using native ghc.
-#  if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined(GHCLIB_API_900) || defined (GHCLIB_API_810)
+#  if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined(GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs.Dump
 #  else
 import HsDumpAst
@@ -28,7 +28,7 @@
 #else
 -- Using ghc-lib-parser. Recent versions will include
 -- GHC.Hs.Dump (it got moved in from ghc-lib on 2020-02-05).
-# if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+# if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs.Dump
 #  else
 -- For simplicity, just assume it's missing from 8.8 ghc-lib-parser
@@ -43,7 +43,7 @@
 import Name
 import DataCon
 import SrcLoc
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs
 #else
 import HsSyn
diff --git a/src/Language/Haskell/GhclibParserEx/Fixity.hs b/src/Language/Haskell/GhclibParserEx/Fixity.hs
--- a/src/Language/Haskell/GhclibParserEx/Fixity.hs
+++ b/src/Language/Haskell/GhclibParserEx/Fixity.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 --
 -- Adapted from (1) https://github.com/mpickering/apply-refact.git and
@@ -15,10 +15,12 @@
   , preludeFixities, baseFixities
   , infixr_, infixl_, infix_, fixity
   ) where
-
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8)
+import GHC.Data.FastString
+#endif
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 import GHC.Hs
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
 import GHC.Types.Fixity
 import GHC.Types.SourceText
 #else
@@ -27,7 +29,7 @@
 import GHC.Types.Name.Reader
 import GHC.Types.Name
 import GHC.Types.SrcLoc
-#elif defined (GHCLIB_API_810)
+#elif defined (GHC_8_10)
 import GHC.Hs
 import BasicTypes
 import RdrName
@@ -44,7 +46,7 @@
 import Data.Data hiding (Fixity)
 import Data.Generics.Uniplate.Data
 
-#if defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_0) || defined (GHC_8_10)
 noExt :: NoExtField
 noExt = noExtField
 #endif
@@ -64,10 +66,10 @@
 -- LPat and Pat have gone through a lot of churn. See
 -- https://gitlab.haskell.org/ghc/ghc/merge_requests/1925 for details.
 patFix :: [(String, Fixity)] -> LPat GhcPs -> LPat GhcPs
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 patFix fixities (L loc (ConPat _ op (InfixCon pat1 pat2))) =
   L loc (mkConOpPat (getFixities fixities) op (findFixity' (getFixities fixities) op) pat1 pat2)
-#elif defined (GHCLIB_API_810)
+#elif defined (GHC_8_10)
 patFix fixities (L loc (ConPatIn op (InfixCon pat1 pat2))) =
   L loc (mkConOpPat (getFixities fixities) op (findFixity' (getFixities fixities) op) pat1 pat2)
 #else
@@ -78,7 +80,7 @@
 
 mkConOpPat ::
   [(String, Fixity)]
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
   -> LocatedN RdrName
 #else
   -> Located RdrName
@@ -86,32 +88,32 @@
   -> Fixity
   -> LPat GhcPs -> LPat GhcPs
   -> Pat GhcPs
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 mkConOpPat fs op2 fix2 p1@(L loc (ConPat _ op1 (InfixCon p11 p12))) p2
-#elif defined (GHCLIB_API_810)
+#elif defined (GHC_8_10)
 mkConOpPat fs op2 fix2 p1@(L loc (ConPatIn op1 (InfixCon p11 p12))) p2
 #else
 mkConOpPat fs op2 fix2 p1@(dL->L loc (ConPatIn op1 (InfixCon p11 p12))) p2
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
   | nofix_error = ConPat noAnn op2 (InfixCon p1 p2)
-#elif defined (GHCLIB_API_900)
+#elif defined (GHC_9_0)
   | nofix_error = ConPat noExtField op2 (InfixCon p1 p2)
 #else
   | nofix_error = ConPatIn op2 (InfixCon p1 p2)
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
   | associate_right = ConPat noAnn op1 (InfixCon p11 (L loc (mkConOpPat fs op2 fix2 p12 p2)))
-#elif defined (GHCLIB_API_900)
+#elif defined (GHC_9_0)
   | associate_right = ConPat noExtField op1 (InfixCon p11 (L loc (mkConOpPat fs op2 fix2 p12 p2)))
-#elif defined (GHCLIB_API_810)
+#elif defined (GHC_8_10)
   | associate_right = ConPatIn op1 (InfixCon p11 (L loc (mkConOpPat fs op2 fix2 p12 p2)))
 #else
   | associate_right = ConPatIn op1 (InfixCon p11 (cL loc (mkConOpPat fs op2 fix2 p12 p2)))
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
   | otherwise = ConPat noAnn op2 (InfixCon p1 p2)
-#elif defined (GHCLIB_API_900)
+#elif defined (GHC_9_0)
   | otherwise = ConPat noExtField op2 (InfixCon p1 p2)
 #else
   | otherwise = ConPatIn op2 (InfixCon p1 p2)
@@ -119,9 +121,9 @@
   where
     fix1 = findFixity' fs op1
     (nofix_error, associate_right) = compareFixity fix1 fix2
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
 mkConOpPat _ op _ p1 p2 = ConPat noAnn op (InfixCon p1 p2)
-#elif defined (GHCLIB_API_900)
+#elif defined (GHC_9_0)
 mkConOpPat _ op _ p1 p2 = ConPat noExtField op (InfixCon p1 p2)
 #else
 mkConOpPat _ op _ p1 p2 = ConPatIn op (InfixCon p1 p2)
@@ -129,7 +131,7 @@
 
 mkOpApp ::
    [(String, Fixity)]
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
    -> SrcSpanAnnA
 #else
    -> SrcSpan
@@ -140,14 +142,14 @@
    -> LHsExpr GhcPs
 --      (e11 `op1` e12) `op2` e2
 mkOpApp fs loc e1@(L _ (OpApp x1 e11 op1 e12)) op2 fix2 e2
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
   | nofix_error = L loc (OpApp noAnn e1 op2 e2)
 #else
   | nofix_error = L loc (OpApp noExt e1 op2 e2)
 #endif
   | associate_right = L loc (OpApp x1 e11 op1 (mkOpApp fs loc' e12 op2 fix2 e2 ))
   where
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
     loc'= combineLocsA e12 e2
 #else
     loc'= combineLocs e12 e2
@@ -156,18 +158,18 @@
     (nofix_error, associate_right) = compareFixity fix1 fix2
 --      (- neg_arg) `op` e2
 mkOpApp fs loc e1@(L _ (NegApp _ neg_arg neg_name)) op2 fix2 e2
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
   | nofix_error = L loc (OpApp noAnn e1 op2 e2)
 #else
   | nofix_error = L loc (OpApp noExt e1 op2 e2)
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
   | associate_right = L loc (NegApp noAnn (mkOpApp fs loc' neg_arg op2 fix2 e2) neg_name)
 #else
   | associate_right = L loc (NegApp noExt (mkOpApp fs loc' neg_arg op2 fix2 e2) neg_name)
 #endif
   where
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
     loc' = combineLocsA neg_arg e2
 #else
     loc' = combineLocs neg_arg e2
@@ -175,7 +177,7 @@
     (nofix_error, associate_right) = compareFixity negateFixity fix2
 --      e1 `op` - neg_arg
 mkOpApp _ loc e1 op1 fix1 e2@(L _ NegApp {}) -- NegApp can occur on the right.
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
   | not associate_right  = L loc (OpApp noAnn e1 op1 e2)-- We *want* right association.
 #else
   | not associate_right  = L loc (OpApp noExt e1 op1 e2)-- We *want* right association.
@@ -183,7 +185,7 @@
   where
     (_, associate_right) = compareFixity fix1 negateFixity
  --     Default case, no rearrangment.
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
 mkOpApp _ loc e1 op _fix e2 = L loc (OpApp noAnn e1 op e2)
 #else
 mkOpApp _ loc e1 op _fix e2 = L loc (OpApp noExt e1 op e2)
@@ -200,7 +202,7 @@
 findFixity :: [(String, Fixity)] -> LHsExpr GhcPs -> Fixity
 findFixity fs r = askFix fs (getIdent r) -- Expressions.
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
 findFixity' :: [(String, Fixity)] -> LocatedN RdrName -> Fixity
 #else
 findFixity' :: [(String, Fixity)] -> Located RdrName -> Fixity
@@ -249,6 +251,7 @@
     , infixl_ 3 ["<|>"]
     , infixr_ 3 ["&&&","***"]
     , infixr_ 2 ["+++","|||"]
+    , infixl_ 1 ["&"]
     , infixr_ 1 ["<=<",">=>",">>>","<<<","^<<","<<^","^>>",">>^"]
     , infixl_ 0 ["on"]
     , infixr_ 0 ["par","pseq"]
@@ -260,18 +263,21 @@
 infix_  = fixity InfixN
 
 fixity :: FixityDirection -> Int -> [String] -> [(String, Fixity)]
+#if defined (GHC_9_10) || defined (GHC_9_8)
+fixity a p = map (,Fixity (SourceText (fsLit "")) p a)
+#else
 fixity a p = map (,Fixity (SourceText "") p a)
-
-#if defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#endif
+#if defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 fixitiesFromModule :: Located HsModule -> [(String, Fixity)]
 #else
 fixitiesFromModule :: Located (HsModule GhcPs) -> [(String, Fixity)]
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)
 fixitiesFromModule (L _ (HsModule _ _ _ _ decls)) = concatMap f decls
-#elif defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#elif defined (GHC_9_4) || defined(GHC_9_2)
 fixitiesFromModule (L _ (HsModule _ _ _ _ _ decls _ _)) = concatMap f decls
-#elif defined (GHCLIB_API_900)
+#elif defined (GHC_9_0)
 fixitiesFromModule (L _ (HsModule _ _ _ _ decls _ _)) = concatMap f decls
 #else
 fixitiesFromModule (L _ (HsModule _ _ _ decls _ _)) = concatMap f decls
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Driver/Flags.hs b/src/Language/Haskell/GhclibParserEx/GHC/Driver/Flags.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Driver/Flags.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Driver/Flags.hs
@@ -1,15 +1,18 @@
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
+-- SPDX-License-Identifier: BSD-3-Clause.
+
 {-# LANGUAGE CPP #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
 #include "ghclib_api.h"
 module Language.Haskell.GhclibParserEx.GHC.Driver.Flags () where
 
-#if !(defined (GHCLIB_API_HEAD) || defined(GHCLIB_API_906) || defined(GHCLIB_API_904)  || defined(GHCLIB_API_902) || defined (GHCLIB_API_900))
+#if ! (defined (GHC_9_10) || defined (GHC_9_8) || defined(GHC_9_6) || defined(GHC_9_4)  || defined(GHC_9_2) || defined (GHC_9_0))
 import DynFlags
 #endif
 
 -- This instance landed in
 -- https://gitlab.haskell.org/ghc/ghc/merge_requests/2905.
-#if defined(GHCLIB_API_808) || defined(GHCLIB_API_810)
+#if defined (GHC_8_8) || defined(GHC_8_10)
 instance Bounded Language where
   minBound = Haskell98
   maxBound = Haskell2010
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Driver/Session.hs b/src/Language/Haskell/GhclibParserEx/GHC/Driver/Session.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Driver/Session.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Driver/Session.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 
 {-# LANGUAGE CPP #-}
@@ -8,21 +8,21 @@
       readExtension
     , extensionImplications
 -- Landed in https://gitlab.haskell.org/ghc/ghc/merge_requests/2654.
-#if defined (GHCLIB_API_808) || defined (GHCLIB_API_810)
+#if defined (GHC_8_8) || defined (GHC_8_10)
     , TurnOnFlag, turnOn, turnOff, impliedGFlags, impliedOffGFlags, impliedXFlags
 #endif
     , parsePragmasIntoDynFlags
   ) where
 
-#if defined (GHCLIB_API_808) || defined (GHCLIB_API_810)
+#if defined (GHC_8_8) || defined (GHC_8_10)
 import qualified GHC.LanguageExtensions as LangExt
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 import GHC.Utils.Panic
 import GHC.Parser.Header
 import GHC.Data.StringBuffer
 import GHC.Driver.Session
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
 import GHC.Types.SourceError
 #else
 import GHC.Driver.Types
@@ -39,12 +39,12 @@
 import Data.Maybe
 import qualified Data.Map as Map
 -- Landed in https://gitlab.haskell.org/ghc/ghc/merge_requests/2707.
-#if defined (GHCLIB_API_808) || defined (GHCLIB_API_810)
+#if defined (GHC_8_8) || defined (GHC_8_10)
 import Data.Function -- For `compareOn`.
 instance Ord Extension where
   compare = compare `on` fromEnum
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 import GHC.Driver.Config.Parser
 #endif
 
@@ -65,7 +65,7 @@
 -- Landed in
 -- https://gitlab.haskell.org/ghc/ghc/merge_requests/2654. Copied from
 -- 'ghc/compiler/main/DynFlags.hs'.
-#if defined(GHCLIB_API_808) || defined(GHCLIB_API_810)
+#if defined(GHC_8_8) || defined(GHC_8_10)
 
 type TurnOnFlag = Bool   -- True  <=> we are turning the flag on
                          -- False <=> we are turning the flag off
@@ -118,7 +118,7 @@
     , (LangExt.TypeInType,       turnOn, LangExt.PolyKinds)
     , (LangExt.TypeInType,       turnOn, LangExt.KindSignatures)
 
-#if defined(GHCLIB_API_810)
+#if defined(GHC_8_10)
     -- Standalone kind signatures are a replacement for CUSKs.
     , (LangExt.StandaloneKindSignatures, turnOff, LangExt.CUSKs)
 #endif
@@ -161,7 +161,7 @@
                          -> IO (Either String DynFlags)
 parsePragmasIntoDynFlags flags (enable, disable) file str =
   catchErrors $ do
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
     let (_, opts) =
           getOptions (initParserOpts flags) (stringToStringBuffer str) file
 #else
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Hs.hs b/src/Language/Haskell/GhclibParserEx/GHC/Hs.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Hs.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Hs.hs
@@ -3,19 +3,18 @@
 
 {-# LANGUAGE CPP #-}
 #include "ghclib_api.h"
-
 module Language.Haskell.GhclibParserEx.GHC.Hs(
    modName
  )
 where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0)
 import GHC.Hs
-#  if !defined (GHCLIB_API_HEAD) && !defined (GHCLIB_API_906)
+#  if !defined (GHC_9_10) && !defined (GHC_9_8) && !defined (GHC_9_6)
 import GHC.Unit.Module
 #  endif
 import GHC.Types.SrcLoc
-#elif defined (GHCLIB_API_810)
+#elif defined (GHC_8_10)
 import GHC.Hs
 import Module
 import SrcLoc
@@ -25,7 +24,7 @@
 import SrcLoc
 #endif
 
-#if defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0)
 modName :: Located HsModule -> String
 #else
 modName :: Located (HsModule GhcPs) -> String
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Binds.hs b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Binds.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Binds.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Binds.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-203, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 {-# LANGUAGE CPP #-}
 #include "ghclib_api.h"
@@ -7,7 +7,7 @@
   )
 where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs.Binds
 import GHC.Hs.Extension
 #else
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Decls.hs b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Decls.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Decls.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Decls.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 
 {-# LANGUAGE CPP #-}
@@ -7,12 +7,12 @@
     isNewType, isForD, isDerivD, isClsDefSig
   ) where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs
 #else
 import HsSyn
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 import GHC.Types.SrcLoc
 #else
 import SrcLoc
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Expr.hs b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Expr.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Expr.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Expr.hs
@@ -7,25 +7,25 @@
 #include "ghclib_api.h"
 module Language.Haskell.GhclibParserEx.GHC.Hs.Expr(
   isTag, isDol, isDot, isReturn, isSection, isRecConstr, isRecUpdate,
-  isVar, isPar, isApp, isOpApp, isAnyApp, isLexeme, isLambda, isQuasiQuote, isQuasiQuoteExpr, isQuasiQuoteSplice,  isOverLabel,
+  isVar, isPar, isApp, isOpApp, isAnyApp, isDo, isLexeme, isLambda, isQuasiQuote, isQuasiQuoteExpr, isQuasiQuoteSplice,  isOverLabel,
   isDotApp, isTypeApp, isWHNF, isLCase,
-  isFieldPun, isFieldPunUpdate, isRecStmt, isParComp, isMDo, isListComp, isMonadComp, isTupleSection, isString, isPrimLiteral,
+  isFieldPun, isFieldPunUpdate, isRecStmt, isLetStmt, isParComp, isMDo, isListComp, isMonadComp, isTupleSection, isString, isPrimLiteral,
   isSpliceDecl, isFieldWildcard, isUnboxed, isWholeFrac, isStrictMatch, isMultiIf, isProc, isTransStmt,
   hasFieldsDotDot,
   varToStr, strToVar,
   fromChar
   ) where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs
 #else
 import HsSyn
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
 import GHC.Types.SourceText
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)
 import Language.Haskell.GhclibParserEx.GHC.Types.Name.Reader
 #endif
 import GHC.Types.SrcLoc
@@ -48,7 +48,7 @@
 isTag tag = \case (L _ (HsVar _ (L _ s))) -> occNameString (rdrNameOcc s) == tag; _ -> False
 
 isDot, isDol, isReturn, isSection, isRecConstr, isRecUpdate,
-  isVar, isPar, isApp, isOpApp, isAnyApp, isLexeme, isQuasiQuote, isQuasiQuoteExpr,
+  isVar, isPar, isApp, isOpApp, isAnyApp, isDo, isLexeme, isQuasiQuote, isQuasiQuoteExpr,
   isLambda, isDotApp, isTypeApp, isWHNF, isLCase, isOverLabel :: LHsExpr GhcPs -> Bool
 isDol = isTag "$"
 isDot = isTag "."
@@ -61,9 +61,10 @@
 isApp = \case (L _ HsApp{}) -> True; _ -> False
 isOpApp = \case (L _ OpApp{}) -> True; _ -> False
 isAnyApp x = isApp x || isOpApp x
+isDo = \case (L _ HsDo{}) -> True; _ -> False
 isLexeme = \case (L _ HsVar{}) -> True; (L _ HsOverLit{}) -> True; (L _ HsLit{}) -> True; _ -> False
 isLambda = \case (L _ HsLam{}) -> True; _ -> False
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)
 isQuasiQuoteExpr = \case (L _ (HsUntypedSplice _ HsQuasiQuote{})) -> True; _ -> False
 #else
 isQuasiQuoteExpr = \case (L _ (HsSpliceE _ HsQuasiQuote{})) -> True; _ -> False
@@ -77,7 +78,7 @@
   (L _ HsLam{}) -> True
   (L _ ExplicitTuple{}) -> True
   (L _ ExplicitList{}) -> True
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
   (L _ (HsPar _ _ x _)) -> isWHNF x
 #else
   (L _ (HsPar _ x)) -> isWHNF x
@@ -91,7 +92,7 @@
 isLCase = \case (L _ HsLamCase{}) -> True; _ -> False
 isOverLabel = \case (L _ HsOverLabel{}) -> True; _ -> False
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)
 isQuasiQuoteSplice :: HsUntypedSplice GhcPs -> Bool
 #else
 isQuasiQuoteSplice :: HsSplice GhcPs -> Bool
@@ -99,7 +100,7 @@
 isQuasiQuoteSplice = \case HsQuasiQuote{} -> True; _ -> False
 
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_901)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHCLIB_API_901)
 isStrictMatch :: HsMatchContext GhcPs -> Bool
 #else
 isStrictMatch :: HsMatchContext RdrName -> Bool
@@ -107,7 +108,7 @@
 isStrictMatch = \case FunRhs{mc_strictness=SrcStrict} -> True; _ -> False
 
 -- Field is punned e.g. '{foo}'.
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 isFieldPun :: LHsFieldBind GhcPs (LFieldOcc GhcPs) (LHsExpr GhcPs) -> Bool
 isFieldPun = \case (L _ HsFieldBind {hfbPun=True}) -> True; _ -> False
 #else
@@ -116,7 +117,7 @@
 #endif
 -- Field puns in updates have a different type to field puns in
 -- constructions.
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 isFieldPunUpdate :: HsFieldBind (LAmbiguousFieldOcc GhcPs) (LHsExpr GhcPs) -> Bool
 isFieldPunUpdate = \case HsFieldBind {hfbPun=True} -> True; _ -> False
 #else
@@ -131,18 +132,21 @@
 isRecStmt :: StmtLR GhcPs GhcPs (LHsExpr GhcPs) -> Bool
 isRecStmt = \case RecStmt{} -> True; _ -> False
 
+isLetStmt :: StmtLR GhcPs GhcPs (LHsExpr GhcPs) -> Bool
+isLetStmt = \case LetStmt{} -> True; _ -> False
+
 isParComp :: StmtLR GhcPs GhcPs (LHsExpr GhcPs) -> Bool
 isParComp = \case ParStmt{} -> True; _ -> False
 
 -- TODO: Seems `HsStmtContext (HsDoRn p)` on master right now.
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 isMDo :: HsDoFlavour -> Bool
 isMDo = \case MDoExpr _ -> True; _ -> False
 isMonadComp :: HsDoFlavour -> Bool
 isMonadComp = \case MonadComp -> True; _ -> False
 isListComp :: HsDoFlavour -> Bool
 isListComp = \case ListComp -> True; _ -> False
-#elif defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#elif defined(GHC_9_2) || defined (GHC_9_0)
 isMDo :: HsStmtContext GhcRn -> Bool
 isMDo = \case MDoExpr _ -> True; _ -> False
 isMonadComp :: HsStmtContext GhcRn -> Bool
@@ -177,7 +181,7 @@
   _ -> False
 
 isSpliceDecl :: HsExpr GhcPs -> Bool
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)
 isSpliceDecl = \case
   HsTypedSplice{} -> True
   HsUntypedSplice{} -> True
@@ -196,25 +200,25 @@
 isTransStmt = \case TransStmt{} -> True; _ -> False
 
 -- Field has a '_' as in '{foo=_} or is punned e.g. '{foo}'.
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 isFieldWildcard :: LHsFieldBind GhcPs (LFieldOcc GhcPs) (LHsExpr GhcPs) -> Bool
 #else
 isFieldWildcard :: LHsRecField GhcPs (LHsExpr GhcPs) -> Bool
 #endif
 isFieldWildcard = \case
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)
 -- Use `Language.Haskell.GhcLibParserEx.GHC.Types.Name.Reader`s `occNameStr` since `HsUnboundVar` now contains a `RdrName` not an `OccName`.
   (L _ HsFieldBind {hfbRHS=(L _ (HsUnboundVar _ s))}) -> occNameStr s == "_"
-#elif defined (GHCLIB_API_904)
+#elif defined (GHC_9_4)
   (L _ HsFieldBind {hfbRHS=(L _ (HsUnboundVar _ s))}) -> occNameString s == "_"
-#elif defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#elif defined(GHC_9_2) || defined (GHC_9_0)
   (L _ HsRecField {hsRecFieldArg=(L _ (HsUnboundVar _ s))}) -> occNameString s == "_"
-#elif defined (GHCLIB_API_810)
+#elif defined (GHC_8_10)
   (L _ HsRecField {hsRecFieldArg=(L _ (HsUnboundVar _ _))}) -> True
 #else
   (L _ HsRecField {hsRecFieldArg=(L _ (EWildPat _))}) -> True
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
   (L _ HsFieldBind {hfbPun=True}) -> True
   (L _ HsFieldBind {}) -> False
 #else
@@ -227,10 +231,10 @@
 
 isWholeFrac :: HsExpr GhcPs -> Bool
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 isWholeFrac (HsLit _ (HsRat _ fl@FL{} _)) = denominator (rationalFromFractionalLit fl) == 1
 isWholeFrac (HsOverLit _ (OverLit _ (HsFractional fl@FL {}) )) = denominator (rationalFromFractionalLit fl) == 1
-#elif defined(GHCLIB_API_902)
+#elif defined(GHC_9_2)
 isWholeFrac (HsLit _ (HsRat _ fl@FL{} _)) = denominator (rationalFromFractionalLit fl) == 1
 isWholeFrac (HsOverLit _ (OverLit _ (HsFractional fl@FL {}) _)) = denominator (rationalFromFractionalLit fl) == 1
 #else
@@ -248,9 +252,9 @@
 varToStr _ = ""
 
 strToVar :: String -> LHsExpr GhcPs
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
 strToVar x = noLocA $ HsVar noExtField (noLocA $ mkRdrUnqual (mkVarOcc x))
-#elif defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#elif defined (GHC_9_0) || defined (GHC_8_10)
 strToVar x = noLoc $ HsVar noExtField (noLoc $ mkRdrUnqual (mkVarOcc x))
 #else
 strToVar x = noLoc $ HsVar noExt (noLoc $ mkRdrUnqual (mkVarOcc x))
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Hs/ExtendInstances.hs b/src/Language/Haskell/GhclibParserEx/GHC/Hs/ExtendInstances.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Hs/ExtendInstances.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Hs/ExtendInstances.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -18,7 +18,7 @@
 -- representations rather than the terms themselves, leads to
 -- identical results.
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 import GHC.Utils.Outputable
 #else
 import Outputable
@@ -39,7 +39,7 @@
 -- string representations.
 toStr :: Data a => HsExtendInstances a -> String
 toStr (HsExtendInstances e) =
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
   showPprUnsafe $ showAstData BlankSrcSpan BlankEpAnnotations e
 #else
   showSDocUnsafe $ showAstData BlankSrcSpan e
@@ -57,7 +57,7 @@
 -- Use 'ppr' for 'Show'.
 instance Outputable a => Show (HsExtendInstances a) where
   show (HsExtendInstances e) =
-#if defined(GHCLIB_API_HEAD) || defined(GHCLIB_API_906) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined(GHC_9_6) || defined(GHC_9_2)
     showPprUnsafe $ ppr e
 #else
     showSDocUnsafe $ ppr e
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Hs/ImpExp.hs b/src/Language/Haskell/GhclibParserEx/GHC/Hs/ImpExp.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Hs/ImpExp.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Hs/ImpExp.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023 Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 {-# LANGUAGE CPP #-}
 #include "ghclib_api.h"
@@ -14,16 +14,16 @@
   )
 where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)
 import GHC.Hs.Extension (GhcPs)
 #endif
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 import GHC.Hs.ImpExp
-#  if !defined (GHCLIB_API_HEAD) && !defined (GHCLIB_API_906)
+#  if !defined (GHC_9_10) && !defined (GHC_9_8) && !defined (GHC_9_6)
 import GHC.Types.Name.Reader
 #  endif
-#elif defined (GHCLIB_API_810)
+#elif defined (GHC_8_10)
 import GHC.Hs.ImpExp
 import RdrName
 #else
@@ -31,7 +31,7 @@
 import RdrName
 #endif
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)
 isPatSynIE :: IEWrappedName GhcPs -> Bool
 #else
 isPatSynIE :: IEWrappedName RdrName -> Bool
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Pat.hs b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Pat.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Pat.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Pat.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-203, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 
 {-# LANGUAGE CPP #-}
@@ -12,12 +12,12 @@
   , isSplicePat
  ) where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs
 #else
 import HsSyn
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0)
 import GHC.Types.SrcLoc
 import GHC.Builtin.Types
 import GHC.Types.Name.Reader
@@ -32,17 +32,17 @@
 #endif
 
 patToStr :: LPat GhcPs -> String
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
 patToStr (L _ (ConPat _ (L _ x) (PrefixCon [] []))) | occNameString (rdrNameOcc x) == "True" = "True"
 patToStr (L _ (ConPat _ (L _ x) (PrefixCon [] []))) | occNameString (rdrNameOcc x) == "False" = "False"
 patToStr (L _ (ConPat _ (L _ x) (PrefixCon [] []))) | occNameString (rdrNameOcc x) == "[]" = "[]"
 patToStr _ = ""
-#elif defined (GHCLIB_API_900)
+#elif defined (GHC_9_0)
 patToStr (L _ (ConPat _ (L _ x) (PrefixCon []))) | occNameString (rdrNameOcc x) == "True" = "True"
 patToStr (L _ (ConPat _ (L _ x) (PrefixCon []))) | occNameString (rdrNameOcc x) == "False" = "False"
 patToStr (L _ (ConPat _ (L _ x) (PrefixCon []))) | occNameString (rdrNameOcc x) == "[]" = "[]"
 patToStr _ = ""
-#elif defined (GHCLIB_API_810)
+#elif defined (GHC_8_10)
 patToStr (L _ (ConPatIn (L _ x) (PrefixCon []))) | occNameString (rdrNameOcc x) == "True" = "True"
 patToStr (L _ (ConPatIn (L _ x) (PrefixCon []))) | occNameString (rdrNameOcc x) == "False" = "False"
 patToStr (L _ (ConPatIn (L _ x) (PrefixCon []))) | occNameString (rdrNameOcc x) == "[]" = "[]"
@@ -57,55 +57,55 @@
 strToPat :: String -> LPat GhcPs
 strToPat z
   | z == "True"  =
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
   noLocA $
-#elif defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#elif defined (GHC_9_0) || defined (GHC_8_10)
   noLoc $
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
     ConPat noAnn (noLocA true_RDR) (PrefixCon [] [])
-#elif defined (GHCLIB_API_900)
+#elif defined (GHC_9_0)
     ConPat noExtField (noLoc true_RDR) (PrefixCon [])
 #else
     ConPatIn (noLoc true_RDR) (PrefixCon [])
 #endif
   | z == "False" =
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
   noLocA $
-#elif defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#elif defined (GHC_9_0) || defined (GHC_8_10)
   noLoc $
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
     ConPat noAnn (noLocA false_RDR) (PrefixCon [] [])
-#elif defined (GHCLIB_API_900)
+#elif defined (GHC_9_0)
     ConPat noExtField (noLoc false_RDR) (PrefixCon [])
 #else
     ConPatIn (noLoc false_RDR) (PrefixCon [])
 #endif
   | z == "[]"    =
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
   noLocA $
-#elif defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#elif defined (GHC_9_0) || defined (GHC_8_10)
   noLoc $
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
     ConPat noAnn (noLocA $ nameRdrName nilDataConName) (PrefixCon [] [])
-#elif defined (GHCLIB_API_900)
+#elif defined (GHC_9_0)
     ConPat noExtField (noLoc $ nameRdrName nilDataConName) (PrefixCon [])
 #else
     ConPatIn (noLoc $ nameRdrName nilDataConName) (PrefixCon [])
 #endif
   | otherwise =
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
       noLocA $ VarPat noExtField (noLocA $ mkVarUnqual (fsLit z))
-#elif defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#elif defined (GHC_9_0) || defined (GHC_8_10)
       noLoc $ VarPat noExtField (noLoc $ mkVarUnqual (fsLit z))
 #else
       VarPat noExt (noLoc $ mkVarUnqual (fsLit z))
 #endif
 
 fromPChar :: LPat GhcPs -> Maybe Char
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 fromPChar (L _ (LitPat _ (HsChar _ x))) = Just x
 #else
 fromPChar (dL -> L _ (LitPat _ (HsChar _ x))) = Just x
@@ -118,16 +118,16 @@
 hasPFieldsDotDot _ = False
 
 -- Field has a '_' as in '{foo=_} or is punned e.g. '{foo}'.
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 isPFieldWildcard :: LHsFieldBind GhcPs (LFieldOcc GhcPs) (LPat GhcPs) -> Bool
 #else
 isPFieldWildcard :: LHsRecField GhcPs (LPat GhcPs) -> Bool
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 isPFieldWildcard (L _ HsFieldBind {hfbRHS=L _ WildPat {}}) = True
 isPFieldWildcard (L _ HsFieldBind {hfbPun=True}) = True
 isPFieldWildcard (L _ HsFieldBind {}) = False
-#elif defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#elif defined (GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 isPFieldWildcard (L _ HsRecField {hsRecFieldArg=L _ WildPat {}}) = True
 isPFieldWildcard (L _ HsRecField {hsRecPun=True}) = True
 isPFieldWildcard (L _ HsRecField {}) = False
@@ -138,21 +138,21 @@
 #endif
 
 isPWildcard :: LPat GhcPs -> Bool
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 isPWildcard (L _ (WildPat _)) = True
 #else
 isPWildcard (dL -> L _ (WildPat _)) = True
 #endif
 isPWildcard _ = False
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 isPFieldPun :: LHsFieldBind GhcPs (LFieldOcc GhcPs) (LPat GhcPs) -> Bool
 #else
 isPFieldPun :: LHsRecField GhcPs (LPat GhcPs) -> Bool
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 isPFieldPun (L _ HsFieldBind {hfbPun=True}) = True
-#elif defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#elif defined (GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 isPFieldPun (L _ HsRecField {hsRecPun=True}) = True
 #else
 isPFieldPun (dL -> L _ HsRecField {hsRecPun=True}) = True
@@ -160,7 +160,7 @@
 isPFieldPun _ = False
 
 isPatTypeSig, isPBangPat, isPViewPat :: LPat GhcPs -> Bool
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 isPatTypeSig (L _ SigPat{}) = True; isPatTypeSig _ = False
 isPBangPat (L _ BangPat{}) = True; isPBangPat _ = False
 isPViewPat (L _ ViewPat{}) = True; isPViewPat _ = False
@@ -171,7 +171,7 @@
 #endif
 
 isSplicePat :: LPat GhcPs -> Bool
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 isSplicePat (L _ SplicePat{}) = True; isSplicePat _ = False
 #else
 isSplicePat (dL -> L _ SplicePat{}) = True; isSplicePat _ = False
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Type.hs b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Type.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Hs/Type.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Hs/Type.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2021, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2021-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 
 {-# LANGUAGE CPP #-}
@@ -9,12 +9,12 @@
   , isTyQuasiQuote, isUnboxedTuple, isKindTyApp
 ) where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs
 #else
 import HsSyn
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0)
 import GHC.Types.SrcLoc
 #else
 import SrcLoc
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Parser.hs b/src/Language/Haskell/GhclibParserEx/GHC/Parser.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Parser.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Parser.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 
 {-# LANGUAGE CPP #-}
@@ -22,20 +22,20 @@
   )
   where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs
 #else
 import HsSyn
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
-#  if defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
+#  if defined (GHC_9_2)
 import GHC.Driver.Config
 #  endif
-#  if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#  if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
 import GHC.Driver.Config.Parser
 #  endif
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 import GHC.Parser.PostProcess
 import GHC.Driver.Session
 import GHC.Data.StringBuffer
@@ -58,7 +58,7 @@
 import PackageConfig
 import RdrName
 #endif
-#if defined (GHCLIB_API_810)
+#if defined (GHC_8_10)
 import RdrHsSyn
 #endif
 
@@ -69,19 +69,19 @@
     location = mkRealSrcLoc (mkFastString "<string>") 1 1
     buffer = stringToStringBuffer str
     parseState =
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
       initParserState (initParserOpts flags) buffer location
 #else
       mkPState flags buffer location
 #endif
-#if defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 parseModule :: String -> DynFlags -> ParseResult (Located HsModule)
 #else
 parseModule :: String -> DynFlags -> ParseResult (Located (HsModule GhcPs))
 #endif
 parseModule = parse Parser.parseModule
 
-#if defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 parseSignature :: String -> DynFlags -> ParseResult (Located HsModule)
 #else
 parseSignature :: String -> DynFlags -> ParseResult (Located (HsModule GhcPs))
@@ -101,7 +101,7 @@
 parseDeclaration = parse Parser.parseDeclaration
 
 parseExpression :: String -> DynFlags -> ParseResult (LHsExpr GhcPs)
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
 parseExpression s flags =
   -- The need for annotations here came about first manifested with
   -- ghc-9.0.1
@@ -112,7 +112,7 @@
           parser = runPV parser_validator :: P (LHsExpr GhcPs)
       in unP parser state :: ParseResult (LHsExpr GhcPs)
     PFailed ps -> PFailed ps
-#elif defined (GHCLIB_API_810) || defined (GHCLIB_API_900)
+#elif defined (GHC_8_10) || defined (GHC_9_0)
 parseExpression s flags =
   case parse Parser.parseExpression s flags of
     POk s e -> unP (runECP_P e) s
@@ -130,7 +130,7 @@
 parseStmt :: String -> DynFlags -> ParseResult (Maybe (LStmt GhcPs (LHsExpr GhcPs)))
 parseStmt = parse Parser.parseStmt
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
 parseIdentifier :: String -> DynFlags -> ParseResult (LocatedN RdrName)
 #else
 parseIdentifier :: String -> DynFlags -> ParseResult (Located RdrName)
@@ -140,14 +140,14 @@
 parseType :: String -> DynFlags -> ParseResult (LHsType GhcPs)
 parseType = parse Parser.parseType
 
-#if defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 parseHeader :: String -> DynFlags -> ParseResult (Located HsModule)
 #else
 parseHeader :: String -> DynFlags -> ParseResult (Located (HsModule GhcPs))
 #endif
 parseHeader = parse Parser.parseHeader
 
-#if defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 parseFile :: String
           -> DynFlags
           -> String
@@ -164,7 +164,7 @@
     location = mkRealSrcLoc (mkFastString filename) 1 1
     buffer = stringToStringBuffer str
     parseState =
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2)
       initParserState (initParserOpts flags) buffer location
 #else
       mkPState flags buffer location
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Settings/Config.hs b/src/Language/Haskell/GhclibParserEx/GHC/Settings/Config.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Settings/Config.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Settings/Config.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 
 {-# OPTIONS_GHC -Wno-missing-fields #-}
@@ -7,19 +7,19 @@
 
 module Language.Haskell.GhclibParserEx.GHC.Settings.Config(
     fakeSettings
-#if !defined (GHCLIB_API_HEAD) && !defined (GHCLIB_API_906)
+#if !defined (GHC_9_10) && !defined (GHC_9_8) && !defined (GHC_9_6)
   , fakeLlvmConfig
 #endif
   )
 where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0)
 import GHC.Settings.Config
 import GHC.Driver.Session
 import GHC.Utils.Fingerprint
 import GHC.Platform
 import GHC.Settings
-#elif defined (GHCLIB_API_810)
+#elif defined (GHC_8_10)
 import Config
 import DynFlags
 import Fingerprint
@@ -34,12 +34,12 @@
 
 fakeSettings :: Settings
 fakeSettings = Settings
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)|| defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)|| defined (GHC_8_10)
   { sGhcNameVersion=ghcNameVersion
   , sFileSettings=fileSettings
   , sTargetPlatform=platform
   , sPlatformMisc=platformMisc
-#  if !defined(GHCLIB_API_HEAD) && !defined(GHCLIB_API_906) && !defined(GHCLIB_API_904) && !defined(GHCLIB_API_902)
+#  if !defined(GHC_9_10) && !defined (GHC_9_8) && !defined(GHC_9_6) && !defined(GHC_9_4) && !defined(GHC_9_2)
   , sPlatformConstants=platformConstants
 #  endif
   , sToolSettings=toolSettings
@@ -53,7 +53,7 @@
   }
 #endif
   where
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)|| defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)|| defined (GHC_8_10)
     toolSettings = ToolSettings {
       toolSettings_opt_P_fingerprint=fingerprint0
       }
@@ -65,11 +65,11 @@
                     }
 #endif
     platform =
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
       genericPlatform
 #else
       Platform{
-#  if defined (GHCLIB_API_900)
+#  if defined (GHC_9_0)
     -- It doesn't matter what values we write here as these fields are
     -- not referenced for our purposes. However the fields are strict
     -- so we must say something.
@@ -82,7 +82,7 @@
       , platformTablesNextToCode=False
       ,
 #  endif
-#  if defined (GHCLIB_API_810) || defined (GHCLIB_API_900)
+#  if defined (GHC_8_10) || defined (GHC_9_0)
         platformWordSize=PW8
       , platformMini=PlatformMini {platformMini_arch=ArchUnknown, platformMini_os=OSUnknown}
 #  else
@@ -92,14 +92,14 @@
       , platformUnregisterised=True
       }
 #endif
-#if !defined(GHCLIB_API_HEAD) && !defined(GHCLIB_API_906) && !defined(GHCLIB_API_904) && !defined(GHCLIB_API_902)
+#if !defined(GHC_9_10) && !defined (GHC_9_8) && !defined(GHC_9_6) && !defined(GHC_9_4) && !defined(GHC_9_2)
     platformConstants =
       PlatformConstants{pc_DYNAMIC_BY_DEFAULT=False,pc_WORD_SIZE=8}
 #endif
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6)
 -- Intentionally empty
-#elif defined(GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)|| defined (GHCLIB_API_810)
+#elif defined(GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)|| defined (GHC_8_10)
 fakeLlvmConfig :: LlvmConfig
 fakeLlvmConfig = LlvmConfig [] []
 #else
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Types/Name/Reader.hs b/src/Language/Haskell/GhclibParserEx/GHC/Types/Name/Reader.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Types/Name/Reader.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Types/Name/Reader.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 
 {-# LANGUAGE CPP #-}
@@ -9,11 +9,11 @@
  )
 where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined(GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined(GHC_9_4) || defined (GHC_9_2)
 import GHC.Parser.Annotation
 #endif
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined(GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined(GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 import GHC.Types.SrcLoc
 import GHC.Types.Name
 import GHC.Types.Name.Reader
@@ -27,7 +27,7 @@
 -- These names may not seem natural here but they work out in
 -- practice. The use of thse two functions is thoroughly ubiquitous.
 occNameStr :: RdrName -> String; occNameStr = occNameString . rdrNameOcc
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined(GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined(GHC_9_4) || defined (GHC_9_2)
 rdrNameStr :: GHC.Parser.Annotation.LocatedN RdrName -> String
 #else
 rdrNameStr :: Located RdrName -> String
@@ -35,7 +35,7 @@
 rdrNameStr = occNameStr . unLoc
 
 -- Builtin type or data constructors.
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined(GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined(GHC_9_4) || defined (GHC_9_2)
 isSpecial :: LocatedN RdrName -> Bool
 #else
 isSpecial :: Located RdrName -> Bool
@@ -45,7 +45,7 @@
 
 -- Coerce qualified names to unqualified (by discarding the
 -- qualifier).
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined(GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined(GHC_9_4) || defined (GHC_9_2)
 unqual :: LocatedN RdrName -> LocatedN RdrName
 #else
 unqual :: Located RdrName -> Located RdrName
@@ -54,7 +54,7 @@
 unqual x = x
 
 -- Extract the occ name from a qualified/unqualified reader name.
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined(GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined(GHC_9_4) || defined (GHC_9_2)
 fromQual :: LocatedN RdrName -> Maybe OccName
 #else
 fromQual :: Located RdrName -> Maybe OccName
diff --git a/src/Language/Haskell/GhclibParserEx/GHC/Utils/Outputable.hs b/src/Language/Haskell/GhclibParserEx/GHC/Utils/Outputable.hs
--- a/src/Language/Haskell/GhclibParserEx/GHC/Utils/Outputable.hs
+++ b/src/Language/Haskell/GhclibParserEx/GHC/Utils/Outputable.hs
@@ -1,4 +1,4 @@
--- Copyright (c) 2020, Shayne Fletcher. All rights reserved.
+-- Copyright (c) 2020-2023, Shayne Fletcher. All rights reserved.
 -- SPDX-License-Identifier: BSD-3-Clause.
 
 {-# LANGUAGE CPP #-}
@@ -8,7 +8,7 @@
 )
 where
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined(GHC_9_2) || defined (GHC_9_0)
 import GHC.Utils.Outputable
 #else
 import Outputable
@@ -16,7 +16,7 @@
 
 unsafePrettyPrint :: Outputable a => a -> String
 unsafePrettyPrint =
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
   showPprUnsafe . ppr
 #else
   showSDocUnsafe . ppr
diff --git a/test/Test.hs b/test/Test.hs
--- a/test/Test.hs
+++ b/test/Test.hs
@@ -17,9 +17,9 @@
 import Data.List.Extra
 import Data.Maybe
 import Data.Generics.Uniplate.Data
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
 import GHC.Data.Bag
-#if !defined (GHCLIB_API_902)
+#if !defined (GHC_9_2)
 import GHC.Driver.Errors.Types
 #endif
 import GHC.Types.Error
@@ -47,21 +47,21 @@
 import Language.Haskell.GhclibParserEx.GHC.Driver.Session
 import Language.Haskell.GhclibParserEx.GHC.Types.Name.Reader
 
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0) || defined (GHC_8_10)
 import GHC.Hs
 #else
 import HsSyn
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0)
 import GHC.Types.SrcLoc
 import GHC.Driver.Session
 import GHC.Parser.Lexer
-# if !defined (GHCLIB_API_HEAD) && !defined (GHCLIB_API_906)
+#  if !defined (GHC_9_10) && !defined (GHC_9_8) && !defined (GHC_9_6)
 import GHC.Utils.Outputable
-#endif
-#  if !defined (GHCLIB_API_900)
+#  endif
+#  if !defined (GHC_9_0)
 import GHC.Driver.Ppr
-#    if !defined (GHCLIB_API_HEAD) && !defined (GHCLIB_API_906) && !defined (GHCLIB_API_904)
+#    if !defined (GHC_9_10) && !defined (GHC_9_8) && !defined (GHC_9_6) && !defined (GHC_9_4)
 import GHC.Parser.Errors.Ppr
 #    endif
 #  endif
@@ -78,14 +78,14 @@
 import OccName
 #endif
 import GHC.LanguageExtensions.Type
-#if defined (GHCLIB_API_808)
+#if defined (GHC_8_8)
 import Bag
 #endif
 
 basicDynFlags :: DynFlags
 basicDynFlags =
   defaultDynFlags fakeSettings
-#if !defined (GHCLIB_API_HEAD) && !defined (GHCLIB_API_906)
+#if !defined (GHC_9_10) && !defined (GHC_9_8) && !defined (GHC_9_6)
                                 fakeLlvmConfig
 #endif
 
@@ -113,13 +113,13 @@
     writeFile relPath contents
     return relPath
 
-#if defined(GHCLIB_API_HEAD) || defined(GHCLIB_API_906)
+#if defined(GHC_9_10) || defined (GHC_9_8) || defined(GHC_9_6)
 report :: DynFlags -> Bag (MsgEnvelope GhcMessage) -> String
 report flags msgs = concat [ showSDoc flags msg | msg <- pprMsgEnvelopeBagWithLocDefault msgs ]
-#elif defined (GHCLIB_API_904)
+#elif defined (GHC_9_4)
 report :: DynFlags -> Bag (MsgEnvelope GhcMessage) -> String
 report flags msgs = concat [ showSDoc flags msg | msg <- pprMsgEnvelopeBagWithLoc msgs ]
-#elif defined (GHCLIB_API_902)
+#elif defined (GHC_9_2)
 report :: DynFlags -> Bag (MsgEnvelope DecoratedSDoc) -> String
 report flags msgs = concat [ showSDoc flags msg | msg <- pprMsgEnvelopeBagWithLoc msgs ]
 #else
@@ -130,29 +130,29 @@
 chkParseResult :: DynFlags -> ParseResult a -> IO ()
 chkParseResult flags = \case
     POk s _ -> do
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
       let (wrns, errs) = getPsMessages s
-#elif defined (GHCLIB_API_902)
+#elif defined (GHC_9_2)
       let (wrns, errs) = getMessages s
 #else
       let (wrns, errs) = getMessages s flags
 #endif
       when (not (null errs) || not (null wrns)) $
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
         assertFailure (
           report flags (getMessages (GhcPsMessage <$> wrns)) ++
           report flags (getMessages (GhcPsMessage <$> errs))
         )
-#elif defined (GHCLIB_API_902)
+#elif defined (GHC_9_2)
         assertFailure (report flags (fmap pprWarning wrns) ++ report flags (fmap pprError errs))
 #else
         assertFailure (report flags wrns ++ report flags errs)
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
     PFailed s -> assertFailure (report flags $ getMessages (GhcPsMessage <$> snd (getPsMessages s)))
-#elif defined (GHCLIB_API_902)
+#elif defined (GHC_9_2)
     PFailed s -> assertFailure (report flags $ fmap pprError (snd (getMessages s)))
-#elif defined (GHCLIB_API_900) || defined (GHCLIB_API_810)
+#elif defined (GHC_9_0) || defined (GHC_8_10)
     PFailed s -> assertFailure (report flags $ snd (getMessages s flags))
 #else
     PFailed _ loc err -> assertFailure (report flags $ unitBag $ mkPlainErrMsg flags loc err)
@@ -223,7 +223,7 @@
   where
     flags = basicDynFlags
 
-#if defined (GHCLIB_API_904) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900)
+#if defined (GHC_9_4) || defined (GHC_9_2) || defined (GHC_9_0)
 moduleTest :: String -> DynFlags -> (Located HsModule -> IO ()) -> IO ()
 #else
 moduleTest :: String -> DynFlags -> (Located (HsModule GhcPs) -> IO ()) -> IO ()
@@ -239,6 +239,12 @@
         POk _ e -> test e
         _ -> assertFailure "parse error"
 
+stmtTest :: String -> DynFlags -> (LStmt GhcPs (LHsExpr GhcPs) -> IO ()) -> IO ()
+stmtTest s flags test =
+      case parseStatement s flags of
+        POk _ e -> test e
+        _ -> assertFailure "parse error"
+
 typeTest :: String -> DynFlags -> (LHsType GhcPs -> IO ()) -> IO ()
 typeTest s flags test =
       case parseType s flags of
@@ -257,7 +263,7 @@
       exprTest "1 + 2 * 3" flags
         (\e ->
             assertBool "parse tree not affected" $
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
               showSDocUnsafe (showAstData BlankSrcSpan BlankEpAnnotations e) /=
               showSDocUnsafe (showAstData BlankSrcSpan BlankEpAnnotations (applyFixities [] e))
 #else
@@ -269,7 +275,7 @@
       case parseDeclaration "f (1 : 2 :[]) = 1" flags of
         POk _ d ->
           assertBool "parse tree not affected" $
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904) || defined (GHCLIB_API_902)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4) || defined (GHC_9_2)
           showSDocUnsafe (showAstData BlankSrcSpan BlankEpAnnotations d) /=
           showSDocUnsafe (showAstData BlankSrcSpan BlankEpAnnotations (applyFixities [] d))
 #else
@@ -323,12 +329,12 @@
   , testCase "isDot" $ test "f . g" $ \case L _ (OpApp _ _ op _) -> assert' $ isDot op; _ -> assertFailure "unexpected"
   , testCase "isReturn" $ test "return x" $ \case L _ (HsApp _ f _) -> assert' $ isReturn f; _ -> assertFailure "unexpected"
   , testCase "isReturn" $ test "pure x" $ \case L _ (HsApp _ f _) -> assert' $ isReturn f; _ -> assertFailure "unexpected"
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
   , testCase "isSection" $ test "(1 +)" $ \case L _ (HsPar _ _ x _) -> assert' $ isSection x; _ -> assertFailure "unexpected"
 #else
   , testCase "isSection" $ test "(1 +)" $ \case L _ (HsPar _ x) -> assert' $ isSection x; _ -> assertFailure "unexpected"
 #endif
-#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_906) || defined (GHCLIB_API_904)
+#if defined (GHC_9_10) || defined (GHC_9_8) || defined (GHC_9_6) || defined (GHC_9_4)
   , testCase "isSection" $ test "(+ 1)" $ \case L _ (HsPar _ _ x _) -> assert' $ isSection x; _ -> assertFailure "unexpected"
 #else
   , testCase "isSection" $ test "(+ 1)" $ \case L _ (HsPar _ x) -> assert' $ isSection x; _ -> assertFailure "unexpected"
@@ -346,6 +352,8 @@
   , testCase "isAnyApp" $ test "l `op` r" $ assert' . isAnyApp
   , testCase "isAnyApp" $ test "f x" $ assert' . isAnyApp
   , testCase "isAnyApp" $ test "f x y" $ assert' . isAnyApp
+  , testCase "isDo" $ test "do pure ()" $ assert' . isDo
+  , testCase "isDo" $ test "12" $ assert' . not . isDo
   , testCase "isAnyApp" $ test "(f x y)" $ assert' . not . isAnyApp
   , testCase "isLexeme" $ test "foo" $ assert' . isLexeme
   , testCase "isLexeme" $ test "3" $ assert' . isLexeme
@@ -355,7 +363,7 @@
   , testCase "isDotApp" $ test "f . g" $ assert' . isDotApp
   , testCase "isDotApp" $ test "f $ g" $ assert' . not . isDotApp
   , testCase "isTypeApp" $ test "f @Int" $ assert' . isTypeApp
-#if defined (GHCLIB_API_808) || defined (GHCLIB_API_810)
+#if defined (GHC_8_8) || defined (GHC_8_10)
   , testCase "isTypeApp" $ test "f @ Int" $ assert' . isTypeApp
 #else
   , testCase "isTypeApp" $ test "f @ Int" $ assert' . not . isTypeApp
@@ -390,17 +398,23 @@
   , testCase "isListComp (2)" $ test_with_exts [ MonadComprehensions ] "[ x + y | x <- xs, y <- ys ]" $ assert' . any isMonadComp . universeBi
   , testCase "isMonadComp (0)" $ test_with_exts [ MonadComprehensions ] "[ x + y | x <- Just 1, y <- Just 2 ]" $ assert' . not . any isListComp . universeBi
   , testCase "isMonadComp (1)" $ test_with_exts [ MonadComprehensions ] "[ x + y | x <- Just 1, y <- Just 2 ]" $ assert' . any isMonadComp . universeBi
-  , testCase "isMonadComp (2)" $ test_with_exts [] "[ x + y | x <- Just 1, y <- Just 2 ]" $ assert' . not . any isMonadComp . universeBi
-  , testCase "isMonadComp (3)" $ test_with_exts [] "[ x + y | x <- Just 1, y <- Just 2 ]" $ assert' . any isListComp . universeBi
+  , testCase "isMonadComp (2)" $ test "[ x + y | x <- Just 1, y <- Just 2 ]" $ assert' . not . any isMonadComp . universeBi
+  , testCase "isMonadComp (3)" $ test "[ x + y | x <- Just 1, y <- Just 2 ]" $ assert' . any isListComp . universeBi
   , testCase "strToVar" $ assert' . isVar . strToVar $ "foo"
   , testCase "varToStr" $ test "[]" $ assert' . (== "[]") . varToStr
   , testCase "varToStr" $ test "foo" $ assert' . (== "foo") . varToStr
   , testCase "varToStr" $ test "3" $ assert' . null . varToStr
+  , testCase "isLetStmt" $ test_stmt "let x = 12" $ assert' . isLetStmt . unLoc
+  , testCase "isLetStmt" $ test_stmt "x <- pure 12" $ assert' . not . isLetStmt . unLoc
+  , testCase "isRecStmt" $ test_stmt_with_exts [ RecursiveDo ]  "rec { xs <- Just (1:xs) }" $ assert' . isRecStmt . unLoc
+  , testCase "isRecStmt" $ test_stmt_with_exts [ RecursiveDo ]  "xs <- Just (1 : xs)" $ assert' . not . isRecStmt . unLoc
   ]
   where
     assert' = assertBool ""
     test s = exprTest s (flags [])
+    test_stmt s = stmtTest s (flags [])
     test_with_exts exts s = exprTest s (flags exts)
+    test_stmt_with_exts exts s = stmtTest s (flags exts)
     flags exts = foldl' xopt_set basicDynFlags
               (exts ++
                  [ TemplateHaskell
