diff --git a/CHANGELOG.rst b/CHANGELOG.rst
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -7,6 +7,19 @@
 .. _PVP: https://pvp.haskell.org/
 
 
+2.4.0.2 (2021-03-14)
+--------------------
+
+* Git: :tag:`dejafu-2.4.0.2`
+* Hackage: :hackage:`dejafu-2.4.0.2`
+
+Fixed
+~~~~~
+
+* (:issue:`334`) Compilation error under GHC 9 due to use of
+  ``const``.
+
+
 2.4.0.1 (2020-12-28)
 --------------------
 
diff --git a/Test/DejaFu/Conc/Internal.hs b/Test/DejaFu/Conc/Internal.hs
--- a/Test/DejaFu/Conc/Internal.hs
+++ b/Test/DejaFu/Conc/Internal.hs
@@ -6,7 +6,7 @@
 
 -- |
 -- Module      : Test.DejaFu.Conc.Internal
--- Copyright   : (c) 2016--2020 Michael Walker
+-- Copyright   : (c) 2016--2021 Michael Walker
 -- License     : MIT
 -- Maintainer  : Michael Walker <mike@barrucadu.co.uk>
 -- Stability   : experimental
@@ -81,7 +81,7 @@
                     , cCState        = initialCState
                     }
   (c, ref) <- runRefCont AStop (Just . Right) (runModelConc ma)
-  let threads0 = launch' Unmasked initialThread (const c) (cThreads ctx)
+  let threads0 = launch' Unmasked initialThread (\_ -> c) (cThreads ctx)
   threads <- case forkBoundThread of
     Just fbt -> makeBound fbt initialThread threads0
     Nothing  -> pure threads0
@@ -100,7 +100,7 @@
 runConcurrencyWithSnapshot sched memtype ctx restore ma = do
   (c, ref) <- runRefCont AStop (Just . Right) (runModelConc ma)
   let threads0 = M.delete initialThread (cThreads ctx)
-  let threads1 = launch' Unmasked initialThread (const c) threads0
+  let threads1 = launch' Unmasked initialThread (\_ -> c) threads0
   threads <- case forkBoundThread of
     Just fbt -> do
       let boundThreads = M.filter (isJust . _bound) threads1
diff --git a/Test/DejaFu/Conc/Internal/Program.hs b/Test/DejaFu/Conc/Internal/Program.hs
--- a/Test/DejaFu/Conc/Internal/Program.hs
+++ b/Test/DejaFu/Conc/Internal/Program.hs
@@ -12,7 +12,7 @@
 
 -- |
 -- Module      : Test.DejaFu.Conc.Internal.Program
--- Copyright   : (c) 2019 Michael Walker
+-- Copyright   : (c) 2019--2021 Michael Walker
 -- License     : MIT
 -- Maintainer  : Michael Walker <mike@barrucadu.co.uk>
 -- Stability   : experimental
@@ -141,7 +141,7 @@
 
   getMaskingState = ModelConc (\c -> AGetMasking c)
 
-  unsafeUnmask ma = ModelConc (AMasking Unmasked (const ma))
+  unsafeUnmask ma = ModelConc (AMasking Unmasked (\_ -> ma))
 
   -- ----------
 
@@ -259,7 +259,7 @@
   :: MonadDejaFu n
   => Program pty n a
   -> n (Maybe (Either Condition (Snapshot pty n a), Trace))
-recordSnapshot ModelConc{..} = pure Nothing
+recordSnapshot ModelConc{} = pure Nothing
 recordSnapshot WithSetup{..} =
   let mkSnapshot snap _ = WS snap
   in defaultRecordSnapshot mkSnapshot wsSetup wsProgram
diff --git a/Test/DejaFu/Refinement.hs b/Test/DejaFu/Refinement.hs
--- a/Test/DejaFu/Refinement.hs
+++ b/Test/DejaFu/Refinement.hs
@@ -7,7 +7,7 @@
 
 -- |
 -- Module      : Test.DejaFu.Refinement
--- Copyright   : (c) 2017--2018 Michael Walker
+-- Copyright   : (c) 2017--2021 Michael Walker
 -- License     : MIT
 -- Maintainer  : Michael Walker <mike@barrucadu.co.uk>
 -- Stability   : experimental
@@ -109,6 +109,7 @@
 
 import           Control.Arrow            (first)
 import           Control.Monad.Conc.Class (fork)
+import           Data.Kind                (Type)
 import           Data.Maybe               (isNothing)
 import           Data.Set                 (Set)
 import qualified Data.Set                 as S
@@ -236,11 +237,11 @@
 class Testable a where
   -- | The observation value type.  This is used to compare the
   -- results.
-  type O a :: *
+  type O a :: Type
 
   -- | The seed value type.  This is used to construct the concurrent
   -- states.
-  type X a :: *
+  type X a :: Type
 
   rpropTiers :: a -> [[([String], RefinementProperty (O a) (X a))]]
 
diff --git a/Test/DejaFu/Types.hs b/Test/DejaFu/Types.hs
--- a/Test/DejaFu/Types.hs
+++ b/Test/DejaFu/Types.hs
@@ -8,7 +8,7 @@
 
 -- |
 -- Module      : Test.DejaFu.Types
--- Copyright   : (c) 2017--2020 Michael Walker
+-- Copyright   : (c) 2017--2021 Michael Walker
 -- License     : MIT
 -- Maintainer  : Michael Walker <mike@barrucadu.co.uk>
 -- Stability   : experimental
@@ -31,6 +31,7 @@
 import           Data.Functor.Contravariant           (Contravariant(..))
 import           Data.Functor.Contravariant.Divisible (Divisible(..))
 import qualified Data.IORef                           as IO
+import           Data.Kind                            (Type)
 import           Data.Map.Strict                      (Map)
 import qualified Data.Map.Strict                      as M
 import           Data.Semigroup                       (Semigroup(..))
@@ -60,7 +61,7 @@
   -- These references are always used from the same Haskell thread, so
   -- it's safe to implement these using unsynchronised primitives with
   -- relaxed-memory behaviours (like @IORef@s).
-  type Ref m :: * -> *
+  type Ref m :: Type -> Type
 
   -- | Create a new reference holding a given initial value.
   newRef :: a -> m (Ref m a)
@@ -74,7 +75,7 @@
   -- | A handle to a bound thread.  If the monad doesn't support bound
   -- threads (for example, if it's not based on @IO@), then this
   -- should be some type which can't be constructed, like 'V1'.
-  type BoundThread m :: * -> *
+  type BoundThread m :: Type -> Type
 
   -- | Fork a new bound thread, if the monad supports them.
   forkBoundThread :: Maybe (m (BoundThread m a))
diff --git a/dejafu.cabal b/dejafu.cabal
--- a/dejafu.cabal
+++ b/dejafu.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                dejafu
-version:             2.4.0.1
+version:             2.4.0.2
 synopsis:            A library for unit-testing concurrent programs.
 
 description:
@@ -33,7 +33,7 @@
 source-repository this
   type:     git
   location: https://github.com/barrucadu/dejafu.git
-  tag:      dejafu-2.4.0.1
+  tag:      dejafu-2.4.0.2
 
 library
   exposed-modules:     Test.DejaFu
