Remove use of const in dejafu (fix for GHC 9.0)

This commit is contained in:
Michael Walker 2021-03-13 22:48:20 +00:00
parent 349767a7b6
commit 4c98a7f6b7
3 changed files with 15 additions and 5 deletions

View File

@ -7,6 +7,16 @@ standard Haskell versioning scheme.
.. _PVP: https://pvp.haskell.org/
unreleased
----------
Fixed
~~~~~
* (:issue:`334`) Compilation error under GHC 9 due to use of
``const``.
2.4.0.1 (2020-12-28)
--------------------

View File

@ -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 @@ runConcurrency invariants forSnapshot sched memtype g idsrc caps ma = do
, 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 :: (MonadDejaFu n, HasCallStack)
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

View File

@ -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 @@ instance (pty ~ Basic, Monad n) => C.MonadConc (Program pty n) where
getMaskingState = ModelConc (\c -> AGetMasking c)
unsafeUnmask ma = ModelConc (AMasking Unmasked (const ma))
unsafeUnmask ma = ModelConc (AMasking Unmasked (\_ -> ma))
-- ----------