diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
 # Changelog for thread-utils-context
 
+## 0.3.0.3
+
+- Fix compilation of purgeDeadThreads on GHC 9.6
+
 ## Unreleased changes
diff --git a/src/Control/Concurrent/Thread/Storage.hs b/src/Control/Concurrent/Thread/Storage.hs
--- a/src/Control/Concurrent/Thread/Storage.hs
+++ b/src/Control/Concurrent/Thread/Storage.hs
@@ -218,7 +218,7 @@
 purgeDeadThreads :: MonadIO m => ThreadStorageMap a -> m ()
 purgeDeadThreads tsm = liftIO $ do
   tids <- listThreads
-  let threadSet = IS.fromList $ map getThreadId tids
+  let threadSet = IS.fromList $ map (fromIntegral . getThreadId) tids
   forM_ [0..(numStripes - 1)] $ \stripe ->
     atomicModifyStripe tsm stripe $ \im -> (I.restrictKeys im threadSet, ())
 #endif
diff --git a/thread-utils-context.cabal b/thread-utils-context.cabal
--- a/thread-utils-context.cabal
+++ b/thread-utils-context.cabal
@@ -5,7 +5,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           thread-utils-context
-version:        0.3.0.2
+version:        0.3.0.3
 synopsis:       Garbage-collected thread local storage
 description:    Please see the README on GitHub at <https://github.com/iand675/thread-utils-context#readme>
 category:       Concurrency
@@ -13,7 +13,7 @@
 bug-reports:    https://github.com/iand675/thread-utils/issues
 author:         Ian Duncan
 maintainer:     ian@iankduncan.com
-copyright:      2021 Ian Duncan
+copyright:      2023 Ian Duncan
 license:        BSD3
 license-file:   LICENSE
 build-type:     Simple
