diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
 # Revision history for hiedb
 
+## 0.4.2.0 -- 2022-09-12
+
+* Support GHC 9.4
+
 ## 0.4.1.0 -- 2021-06-29
 
 * Support GHC 9.2 (@fendor)
diff --git a/hiedb.cabal b/hiedb.cabal
--- a/hiedb.cabal
+++ b/hiedb.cabal
@@ -1,6 +1,6 @@
 cabal-version:       2.4
 name:                hiedb
-version:             0.4.1.0
+version:             0.4.2.0
 synopsis:            Generates a references DB from .hie files
 description:         Tool and library to index and query a collection of `.hie` files
 bug-reports:         https://github.com/wz1000/HieDb/issues
@@ -26,7 +26,7 @@
 
 common common-options
   default-language:    Haskell2010
-  build-depends:       base >= 4.12 && < 4.16
+  build-depends:       base >= 4.12 && < 4.18
   ghc-options:         -Wall
                        -Wincomplete-uni-patterns
                        -Wincomplete-record-updates
@@ -62,15 +62,15 @@
                      , directory
                      , mtl
                      , sqlite-simple
-                     , hie-compat
+                     , hie-compat ^>= 0.3
                      , text
                      , bytestring
-                     , algebraic-graphs
+                     , algebraic-graphs >= 0.3 && < 0.7
                      , lucid
                      , optparse-applicative
                      , extra
-                     , ansi-terminal
-                     , terminal-size
+                     , ansi-terminal >= 0.9
+                     , terminal-size >= 0.2
 
 test-suite hiedb-tests
   import:             common-options
diff --git a/src/HieDb/Compat.hs b/src/HieDb/Compat.hs
--- a/src/HieDb/Compat.hs
+++ b/src/HieDb/Compat.hs
@@ -112,7 +112,9 @@
 import Name
 import NameCache
 import Outputable (showSDoc, ppr, (<+>), hang, text)
+#if __GLASGOW_HASKELL__ < 903
 import IfaceEnv (NameCacheUpdater(..))
+#endif
 import IfaceType
 import UniqSupply
 import SrcLoc
@@ -194,4 +196,8 @@
 #else
 -- pattern synonym that is never populated
 pattern AvailFL x <- Avail.Avail ((\_ -> (True, undefined)) -> (False, x))
+#endif
+
+#if __GLASGOW_HASKELL__ >= 903
+type NameCacheUpdater = NameCache
 #endif
diff --git a/src/HieDb/Types.hs b/src/HieDb/Types.hs
--- a/src/HieDb/Types.hs
+++ b/src/HieDb/Types.hs
@@ -6,6 +6,7 @@
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE StandaloneDeriving #-}
 {-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE CPP #-}
 {-# OPTIONS_GHC -Wno-orphans #-}
 module HieDb.Types where
 
@@ -244,7 +245,11 @@
 runDbM nc x = flip runReaderT nc $ runDbMonad x
 
 instance MonadIO m => NameCacheMonad (DbMonadT m) where
+#if __GLASGOW_HASKELL__ >= 903
+  getNcUpdater = DbMonadT $ ReaderT $ \ref -> liftIO $ readIORef ref
+#else
   getNcUpdater = DbMonadT $ ReaderT $ \ref -> pure (NCU $ atomicModifyIORef' ref)
+#endif
 
 
 data HieDbErr
diff --git a/src/HieDb/Utils.hs b/src/HieDb/Utils.hs
--- a/src/HieDb/Utils.hs
+++ b/src/HieDb/Utils.hs
@@ -38,6 +38,7 @@
 import HieDb.Types
 import HieDb.Compat
 import Database.SQLite.Simple
+import Control.Concurrent
 
 addTypeRef :: HieDb -> FilePath -> A.Array TypeIndex HieTypeFlat -> A.Array TypeIndex (Maybe Int64) -> RealSrcSpan -> TypeIndex -> IO ()
 addTypeRef (getConn -> conn) hf arr ixs sp = go 0
@@ -75,8 +76,12 @@
 
 makeNc :: IO NameCache
 makeNc = do
+#if __GLASGOW_HASKELL__ >= 903
+  initNameCache 'z' []
+#else
   uniq_supply <- mkSplitUniqSupply 'z'
   return $ initNameCache uniq_supply []
+#endif
 
 -- | Recursively search for @.hie@ and @.hie-boot@  files in given directory
 getHieFilesIn :: FilePath -> IO [FilePath]
@@ -109,7 +114,12 @@
   ncr <- newIORef =<< makeNc
   _ <- runDbM ncr $ withHieFile file (const $ return ())
   nc <- readIORef ncr
-  return $ case lookupOrigNameCache (nsNames nc) mdl occ of
+#if __GLASGOW_HASKELL__ >= 903
+  nsns <- readMVar (nsNames nc)
+#else
+  let nsns = nsNames nc
+#endif
+  return $ case lookupOrigNameCache nsns mdl occ of
     Just name -> case nameSrcSpan name of
 #if __GLASGOW_HASKELL__ >= 900
       RealSrcSpan sp _ -> Right (sp, mdl)
