diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,20 @@
+## Changes in 3.2.6:
+
+ * Support for the GHC 9.2.
+
+   The array access primops now use the fixed-sized numeric types
+   corresponding to the width of the data accessed. Additionally, the
+   primops to convert to and from fixed-sized numeric types have been
+   given new names.
+
+   9.2 isn't cut yet, so these changes are somewhat speculative.
+   Unfortunately, GHC must used a released version of Alex (and Happy)
+   at all times until further changes have been made, so we must make
+   the release to actually implement these changes in GHC.
+
+   If the final GHC 9.2 ends up being different, this release will be
+   marked broken to make it less likely people use it by accident.
+
 ## Changes in 3.2.5:
 
  * Build fixes for GHC 8.8.x
diff --git a/alex.cabal b/alex.cabal
--- a/alex.cabal
+++ b/alex.cabal
@@ -1,6 +1,6 @@
-cabal-version: >= 1.8
+cabal-version: >= 1.10
 name: alex
-version: 3.2.5
+version: 3.2.6
 -- don't forget updating changelog.md!
 license: BSD3
 license-file: LICENSE
@@ -115,8 +115,12 @@
 
   build-depends: base < 5
 
-  extensions: CPP
+  default-language: Haskell98
+  default-extensions: CPP
+  other-extensions: MagicHash
+
   ghc-options: -Wall -rtsopts
+
   other-modules:
         AbsSyn
         CharSet
@@ -145,5 +149,7 @@
   main-is: test.hs
   -- This line is important as it ensures that the local `exe:alex` component declared above is built before the test-suite component is invoked, as well as making sure that `alex` is made available on $PATH and `$alex_datadir` is set accordingly before invoking `test.hs`
   build-tools: alex
+
+  default-language: Haskell98
 
   build-depends: base, process
diff --git a/data/AlexTemplate b/data/AlexTemplate
--- a/data/AlexTemplate
+++ b/data/AlexTemplate
@@ -70,7 +70,16 @@
 
 
 
+
+
+
+
+
 alexIndexInt16OffAddr arr off = arr ! off
+
+
+
+
 
 
 
diff --git a/data/AlexTemplate-debug b/data/AlexTemplate-debug
--- a/data/AlexTemplate-debug
+++ b/data/AlexTemplate-debug
@@ -70,7 +70,16 @@
 
 
 
+
+
+
+
+
 alexIndexInt16OffAddr arr off = arr ! off
+
+
+
+
 
 
 
diff --git a/data/AlexTemplate-ghc b/data/AlexTemplate-ghc
--- a/data/AlexTemplate-ghc
+++ b/data/AlexTemplate-ghc
@@ -24,6 +24,7 @@
 
 
 
+
 -- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
 #if __GLASGOW_HASKELL__ > 706
 #define GTE(n,m) (tagToEnum# (n >=# m))
@@ -58,6 +59,7 @@
 #endif
 
 {-# INLINE alexIndexInt16OffAddr #-}
+alexIndexInt16OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt16OffAddr (AlexA# arr) off =
 #ifdef WORDS_BIGENDIAN
   narrow16Int# i
@@ -67,14 +69,18 @@
         low  = int2Word# (ord# (indexCharOffAddr# arr off'))
         off' = off *# 2#
 #else
-  indexInt16OffAddr# arr off
+#if __GLASGOW_HASKELL__ >= 901
+  int16ToInt#
 #endif
+    (indexInt16OffAddr# arr off)
+#endif
 
 
 
 
 
 {-# INLINE alexIndexInt32OffAddr #-}
+alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt32OffAddr (AlexA# arr) off =
 #ifdef WORDS_BIGENDIAN
   narrow32Int# i
@@ -88,7 +94,10 @@
    b0   = int2Word# (ord# (indexCharOffAddr# arr off'))
    off' = off *# 4#
 #else
-  indexInt32OffAddr# arr off
+#if __GLASGOW_HASKELL__ >= 901
+  int32ToInt#
+#endif
+    (indexInt32OffAddr# arr off)
 #endif
 
 
diff --git a/data/AlexTemplate-ghc-debug b/data/AlexTemplate-ghc-debug
--- a/data/AlexTemplate-ghc-debug
+++ b/data/AlexTemplate-ghc-debug
@@ -24,6 +24,7 @@
 
 
 
+
 -- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
 #if __GLASGOW_HASKELL__ > 706
 #define GTE(n,m) (tagToEnum# (n >=# m))
@@ -58,6 +59,7 @@
 #endif
 
 {-# INLINE alexIndexInt16OffAddr #-}
+alexIndexInt16OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt16OffAddr (AlexA# arr) off =
 #ifdef WORDS_BIGENDIAN
   narrow16Int# i
@@ -67,14 +69,18 @@
         low  = int2Word# (ord# (indexCharOffAddr# arr off'))
         off' = off *# 2#
 #else
-  indexInt16OffAddr# arr off
+#if __GLASGOW_HASKELL__ >= 901
+  int16ToInt#
 #endif
+    (indexInt16OffAddr# arr off)
+#endif
 
 
 
 
 
 {-# INLINE alexIndexInt32OffAddr #-}
+alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt32OffAddr (AlexA# arr) off =
 #ifdef WORDS_BIGENDIAN
   narrow32Int# i
@@ -88,7 +94,10 @@
    b0   = int2Word# (ord# (indexCharOffAddr# arr off'))
    off' = off *# 4#
 #else
-  indexInt32OffAddr# arr off
+#if __GLASGOW_HASKELL__ >= 901
+  int32ToInt#
+#endif
+    (indexInt32OffAddr# arr off)
 #endif
 
 
diff --git a/data/AlexTemplate-ghc-nopred b/data/AlexTemplate-ghc-nopred
--- a/data/AlexTemplate-ghc-nopred
+++ b/data/AlexTemplate-ghc-nopred
@@ -24,6 +24,7 @@
 
 
 
+
 -- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
 #if __GLASGOW_HASKELL__ > 706
 #define GTE(n,m) (tagToEnum# (n >=# m))
@@ -58,6 +59,7 @@
 #endif
 
 {-# INLINE alexIndexInt16OffAddr #-}
+alexIndexInt16OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt16OffAddr (AlexA# arr) off =
 #ifdef WORDS_BIGENDIAN
   narrow16Int# i
@@ -67,14 +69,18 @@
         low  = int2Word# (ord# (indexCharOffAddr# arr off'))
         off' = off *# 2#
 #else
-  indexInt16OffAddr# arr off
+#if __GLASGOW_HASKELL__ >= 901
+  int16ToInt#
 #endif
+    (indexInt16OffAddr# arr off)
+#endif
 
 
 
 
 
 {-# INLINE alexIndexInt32OffAddr #-}
+alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt32OffAddr (AlexA# arr) off =
 #ifdef WORDS_BIGENDIAN
   narrow32Int# i
@@ -88,7 +94,10 @@
    b0   = int2Word# (ord# (indexCharOffAddr# arr off'))
    off' = off *# 4#
 #else
-  indexInt32OffAddr# arr off
+#if __GLASGOW_HASKELL__ >= 901
+  int32ToInt#
+#endif
+    (indexInt32OffAddr# arr off)
 #endif
 
 
diff --git a/src/AbsSyn.hs b/src/AbsSyn.hs
--- a/src/AbsSyn.hs
+++ b/src/AbsSyn.hs
@@ -324,9 +324,9 @@
  where
   (new_tokens, decls) = unzip (zipWith f (scannerTokens scanner) act_names)
 
-  f r@RECtx{ reCtxCode = Just code } name
+  f r@(RECtx{ reCtxCode = Just code }) name
         = (r{reCtxCode = Just name}, Just (mkDecl name code))
-  f r@RECtx{ reCtxCode = Nothing } _
+  f r@(RECtx{ reCtxCode = Nothing }) _
         = (r{reCtxCode = Nothing}, Nothing)
 
   gscanActionType res =
diff --git a/src/DFAMin.hs b/src/DFAMin.hs
--- a/src/DFAMin.hs
+++ b/src/DFAMin.hs
@@ -32,9 +32,9 @@
 -- end;
 
 minimizeDFA :: Ord a => DFA Int a -> DFA Int a
-minimizeDFA  dfa@ DFA { dfa_start_states = starts,
-                        dfa_states       = statemap
-                      }
+minimizeDFA dfa@(DFA { dfa_start_states = starts,
+                       dfa_states       = statemap
+                     })
   = DFA { dfa_start_states = starts,
           dfa_states       = Map.fromList states }
   where
diff --git a/src/Parser.hs b/src/Parser.hs
--- a/src/Parser.hs
+++ b/src/Parser.hs
@@ -27,7 +27,7 @@
 import Control.Applicative(Applicative(..))
 import Control.Monad (ap)
 
--- parser produced by Happy Version 1.19.10
+-- parser produced by Happy Version 1.19.12
 
 newtype HappyAbsSyn  = HappyAbsSyn HappyAny
 #if __GLASGOW_HASKELL__ >= 607
@@ -1059,468 +1059,7 @@
   "utf8"       -> return UTF8
   _            -> failP ("encoding " ++ show s ++ " not supported")
 {-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
-{-# LINE 1 "<built-in>" #-}
-{-# LINE 1 "<command-line>" #-}
-{-# LINE 10 "<command-line>" #-}
-# 1 "/usr/include/stdc-predef.h" 1 3 4
-
-# 17 "/usr/include/stdc-predef.h" 3 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{-# LINE 10 "<command-line>" #-}
-{-# LINE 1 "/home/smarlow/local/lib/ghc-8.4.3/include/ghcversion.h" #-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{-# LINE 10 "<command-line>" #-}
-{-# LINE 1 "/tmp/ghc27342_0/ghc_2.h" #-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+-- $Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp $
 
 
 
@@ -1534,6 +1073,16 @@
 
 
 
+-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
+#if __GLASGOW_HASKELL__ > 706
+#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)
+#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)
+#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)
+#else
+#define LT(n,m) (n Happy_GHC_Exts.<# m)
+#define GTE(n,m) (n Happy_GHC_Exts.>=# m)
+#define EQ(n,m) (n Happy_GHC_Exts.==# m)
+#endif
 
 
 
@@ -1553,6 +1102,7 @@
 
 
 
+data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList
 
 
 
@@ -1593,48 +1143,6 @@
 
 
 
-{-# LINE 10 "<command-line>" #-}
-{-# LINE 1 "templates/GenericTemplate.hs" #-}
--- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp 
-
-
-
-
-
-
-
-
-
-
-
-
-
--- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
-#if __GLASGOW_HASKELL__ > 706
-#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)
-#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)
-#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)
-#else
-#define LT(n,m) (n Happy_GHC_Exts.<# m)
-#define GTE(n,m) (n Happy_GHC_Exts.>=# m)
-#define EQ(n,m) (n Happy_GHC_Exts.==# m)
-#endif
-{-# LINE 43 "templates/GenericTemplate.hs" #-}
-
-data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList
-
-
-
-
-
-
-
-{-# LINE 65 "templates/GenericTemplate.hs" #-}
-
-{-# LINE 75 "templates/GenericTemplate.hs" #-}
-
-{-# LINE 84 "templates/GenericTemplate.hs" #-}
-
 infixr 9 `HappyStk`
 data HappyStk a = HappyStk a (HappyStk a)
 
@@ -1646,7 +1154,7 @@
 -----------------------------------------------------------------------------
 -- Accepting the parse
 
--- If the current token is 0#, it means we've just accepted a partial
+-- If the current token is ERROR_TOK, it means we've just accepted a partial
 -- parse (a %partial parser).  We must ignore the saved token on the top of
 -- the stack in this case.
 happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =
@@ -1661,24 +1169,19 @@
 
 happyDoAction i tk st
         = {- nothing -}
-
-
           case action of
                 0#           -> {- nothing -}
                                      happyFail (happyExpListPerState ((Happy_GHC_Exts.I# (st)) :: Int)) i tk st
                 -1#          -> {- nothing -}
                                      happyAccept i tk st
                 n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}
-
                                                    (happyReduceArr Happy_Data_Array.! rule) i tk st
                                                    where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))
                 n                 -> {- nothing -}
-
-
                                      happyShift new_state i tk st
                                      where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))
    where off    = happyAdjustOffset (indexShortOffAddr happyActOffsets st)
-         off_i  = (off Happy_GHC_Exts.+#  i)
+         off_i  = (off Happy_GHC_Exts.+# i)
          check  = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))
                   then EQ(indexShortOffAddr happyCheck off_i, i)
                   else False
@@ -1719,8 +1222,18 @@
 -----------------------------------------------------------------------------
 -- HappyState data type (not arrays)
 
-{-# LINE 180 "templates/GenericTemplate.hs" #-}
 
+
+
+
+
+
+
+
+
+
+
+
 -----------------------------------------------------------------------------
 -- Shifting a token
 
@@ -1781,7 +1294,7 @@
          let drop_stk = happyDropStk k stk
 
              off = happyAdjustOffset (indexShortOffAddr happyGotoOffsets st1)
-             off_i = (off Happy_GHC_Exts.+#  nt)
+             off_i = (off Happy_GHC_Exts.+# nt)
              new_state = indexShortOffAddr happyTable off_i
 
 
@@ -1804,14 +1317,14 @@
    {- nothing -}
    happyDoAction j tk new_state
    where off = happyAdjustOffset (indexShortOffAddr happyGotoOffsets st)
-         off_i = (off Happy_GHC_Exts.+#  nt)
+         off_i = (off Happy_GHC_Exts.+# nt)
          new_state = indexShortOffAddr happyTable off_i
 
 
 
 
 -----------------------------------------------------------------------------
--- Error recovery (0# is the error token)
+-- Error recovery (ERROR_TOK is the error token)
 
 -- parse error if we are in recovery and we fail again
 happyFail explist 0# tk old_st _ stk@(x `HappyStk` _) =
@@ -1824,17 +1337,17 @@
     for now --SDM
 
 -- discard a state
-happyFail  0# tk old_st (HappyCons ((action)) (sts)) 
+happyFail  ERROR_TOK tk old_st CONS(HAPPYSTATE(action),sts) 
                                                 (saved_tok `HappyStk` _ `HappyStk` stk) =
 --      trace ("discarding state, depth " ++ show (length stk))  $
-        happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))
+        DO_ACTION(action,ERROR_TOK,tk,sts,(saved_tok`HappyStk`stk))
 -}
 
 -- Enter error recovery: generate an error token,
 --                       save the old token and carry on.
 happyFail explist i tk (action) sts stk =
 --      trace "entering error recovery" $
-        happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)
+        happyDoAction 0# tk action sts ((Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)
 
 -- Internal happy errors:
 
diff --git a/src/Scan.hs b/src/Scan.hs
--- a/src/Scan.hs
+++ b/src/Scan.hs
@@ -15,11 +15,11 @@
 #endif
 #if __GLASGOW_HASKELL__ >= 503
 import Data.Array
-import Data.Array.Base (unsafeAt)
 #else
 import Array
 #endif
 #if __GLASGOW_HASKELL__ >= 503
+import Data.Array.Base (unsafeAt)
 import GHC.Exts
 #else
 import GlaExts
@@ -490,6 +490,7 @@
 
 
 
+
 -- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
 #if __GLASGOW_HASKELL__ > 706
 #define GTE(n,m) (tagToEnum# (n >=# m))
@@ -524,6 +525,7 @@
 #endif
 
 {-# INLINE alexIndexInt16OffAddr #-}
+alexIndexInt16OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt16OffAddr (AlexA# arr) off =
 #ifdef WORDS_BIGENDIAN
   narrow16Int# i
@@ -533,14 +535,18 @@
         low  = int2Word# (ord# (indexCharOffAddr# arr off'))
         off' = off *# 2#
 #else
-  indexInt16OffAddr# arr off
+#if __GLASGOW_HASKELL__ >= 901
+  int16ToInt#
 #endif
+    (indexInt16OffAddr# arr off)
+#endif
 
 
 
 
 
 {-# INLINE alexIndexInt32OffAddr #-}
+alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt32OffAddr (AlexA# arr) off =
 #ifdef WORDS_BIGENDIAN
   narrow32Int# i
@@ -554,7 +560,10 @@
    b0   = int2Word# (ord# (indexCharOffAddr# arr off'))
    off' = off *# 4#
 #else
-  indexInt32OffAddr# arr off
+#if __GLASGOW_HASKELL__ >= 901
+  int32ToInt#
+#endif
+    (indexInt32OffAddr# arr off)
 #endif
 
 
diff --git a/templates/GenericTemplate.hs b/templates/GenericTemplate.hs
--- a/templates/GenericTemplate.hs
+++ b/templates/GenericTemplate.hs
@@ -12,6 +12,7 @@
 #define ALEX_IF_GHC_GT_500 #if __GLASGOW_HASKELL__ > 500
 #define ALEX_IF_GHC_LT_503 #if __GLASGOW_HASKELL__ < 503
 #define ALEX_IF_GHC_GT_706 #if __GLASGOW_HASKELL__ > 706
+#define ALEX_IF_GHC_GE_901 #if __GLASGOW_HASKELL__ >= 901
 #define ALEX_ELIF_GHC_500 #elif __GLASGOW_HASKELL__ == 500
 #define ALEX_IF_BIGENDIAN #ifdef WORDS_BIGENDIAN
 #define ALEX_ELSE #else
@@ -57,6 +58,7 @@
 ALEX_ENDIF
 
 {-# INLINE alexIndexInt16OffAddr #-}
+alexIndexInt16OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt16OffAddr (AlexA# arr) off =
 ALEX_IF_BIGENDIAN
   narrow16Int# i
@@ -66,14 +68,18 @@
         low  = int2Word# (ord# (indexCharOffAddr# arr off'))
         off' = off *# 2#
 ALEX_ELSE
-  indexInt16OffAddr# arr off
+ALEX_IF_GHC_GE_901
+  int16ToInt#
 ALEX_ENDIF
+    (indexInt16OffAddr# arr off)
+ALEX_ENDIF
 #else
 alexIndexInt16OffAddr arr off = arr ! off
 #endif
 
 #ifdef ALEX_GHC
 {-# INLINE alexIndexInt32OffAddr #-}
+alexIndexInt32OffAddr :: AlexAddr -> Int# -> Int#
 alexIndexInt32OffAddr (AlexA# arr) off =
 ALEX_IF_BIGENDIAN
   narrow32Int# i
@@ -87,7 +93,10 @@
    b0   = int2Word# (ord# (indexCharOffAddr# arr off'))
    off' = off *# 4#
 ALEX_ELSE
-  indexInt32OffAddr# arr off
+ALEX_IF_GHC_GE_901
+  int32ToInt#
+ALEX_ENDIF
+    (indexInt32OffAddr# arr off)
 ALEX_ENDIF
 #else
 alexIndexInt32OffAddr arr off = arr ! off
