diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e3e20b9..e8240f8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,6 +51,7 @@ jobs: - lts-13.3 # ghc-8.6 - lts-15.0 # ghc-8.8 - lts-17.0 # ghc-8.10 + - lts-19.0 # ghc-9.0 steps: - uses: actions/checkout@v2.3.4 diff --git a/.hlint.yaml b/.hlint.yaml index fb65446..9bceaff 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -51,3 +51,8 @@ - ignore: {name: "Alternative law, right identity", within: Examples.ClassLaws} - ignore: {name: "Alternative law, left identity", within: Examples.ClassLaws} - ignore: {name: "Monoid law, right identity", within: Unit.Properties} + +# Not implemented +- ignore: {name: "Use newEmptyTMVarIO"} +- ignore: {name: "Use newTMVarIO"} +- ignore: {name: "Use newTVarIO"} diff --git a/concurrency/Control/Concurrent/Classy/Async.hs b/concurrency/Control/Concurrent/Classy/Async.hs index bedcdd5..b94c3d8 100644 --- a/concurrency/Control/Concurrent/Classy/Async.hs +++ b/concurrency/Control/Concurrent/Classy/Async.hs @@ -754,7 +754,7 @@ forConcurrently_ = flip mapConcurrently_ -- -- @since 1.1.2.0 replicateConcurrently :: MonadConc m => Int -> m a -> m [a] -replicateConcurrently i = runConcurrently . sequenceA . replicate i . Concurrently +replicateConcurrently i = runConcurrently . replicateM i . Concurrently -- | 'replicateConcurrently_' is 'replicateConcurrently' with the -- return values discarded. diff --git a/dejafu-tests/lib/Examples/ParMonad.hs b/dejafu-tests/lib/Examples/ParMonad.hs index f5f0c1b..5773a29 100644 --- a/dejafu-tests/lib/Examples/ParMonad.hs +++ b/dejafu-tests/lib/Examples/ParMonad.hs @@ -16,10 +16,9 @@ tests = toTestList parFilter :: (MonadConc m, MonadIO m) => m Bool parFilter = do - let p x = x `mod` 2 == 0 let xs = [0..1] :: [Int] - s <- Par.runParIO $ parfilter p xs - pure (s == filter p xs) + s <- Par.runParIO $ parfilter even xs + pure (s == filter even xs) where parfilter _ [] = pure [] parfilter f [x] = pure [x | f x] diff --git a/dejafu/CHANGELOG.rst b/dejafu/CHANGELOG.rst index 98c1d0a..41fee7e 100644 --- a/dejafu/CHANGELOG.rst +++ b/dejafu/CHANGELOG.rst @@ -6,6 +6,14 @@ standard Haskell versioning scheme. .. _PVP: https://pvp.haskell.org/ +unreleased +---------- + +Miscellaneous +~~~~~~~~~~~~~ + +* Update doctest examples in `Test.DejaFu`. + 2.4.0.3 (2021-08-15) -------------------- diff --git a/dejafu/Test/DejaFu.hs b/dejafu/Test/DejaFu.hs index 9ea3872..2c8f5a1 100644 --- a/dejafu/Test/DejaFu.hs +++ b/dejafu/Test/DejaFu.hs @@ -491,7 +491,7 @@ dejafu = dejafuWithSettings defaultSettings -- [fail] Randomly! -- "hello" S0----S1--S0-- -- --- "world" S0----S2--S1-S0-- +-- "world" S0---P2--S0-- -- False -- -- @since 2.1.0.0 @@ -517,7 +517,7 @@ dejafuWay way = dejafuWithSettings . fromWayAndMemType way -- [fail] Randomly! -- "hello" S0----S1--S0-- -- --- "world" S0----S2--S1-S0-- +-- "world" S0---P2--S0-- -- False -- -- @since 2.1.0.0 diff --git a/dejafu/Test/DejaFu/Conc.hs b/dejafu/Test/DejaFu/Conc.hs index 3768aab..d26f768 100755 --- a/dejafu/Test/DejaFu/Conc.hs +++ b/dejafu/Test/DejaFu/Conc.hs @@ -57,6 +57,7 @@ module Test.DejaFu.Conc ) where import Control.Exception (MaskingState(..)) +import Control.Monad (void) import Test.DejaFu.Conc.Internal.Common import Test.DejaFu.Conc.Internal.Program @@ -164,7 +165,7 @@ withSetupAndTeardown setup teardown = -- -- @since 2.0.0.0 registerInvariant :: Invariant n a -> Program Basic n () -registerInvariant inv = ModelConc (\c -> ANewInvariant (() <$ inv) (c ())) +registerInvariant inv = ModelConc (\c -> ANewInvariant (void inv) (c ())) -- | Read the content of an @IORef@. -- diff --git a/dejafu/Test/DejaFu/Conc/Internal/Threading.hs b/dejafu/Test/DejaFu/Conc/Internal/Threading.hs index 13c8f43..a8eec76 100644 --- a/dejafu/Test/DejaFu/Conc/Internal/Threading.hs +++ b/dejafu/Test/DejaFu/Conc/Internal/Threading.hs @@ -81,7 +81,7 @@ propagate e tid threads = raise <$> propagate' handlers where raise (ms, act, hs) = except ms act hs tid threads propagate' [] = Nothing - propagate' (Handler ms h:hs) = maybe (propagate' hs) (\act -> Just (ms, act, hs)) $ h <$> fromException e + propagate' (Handler ms h:hs) = maybe (propagate' hs) ((\act -> Just (ms, act, hs)) . h) (fromException e) -- | Check if a thread can be interrupted by an exception. interruptible :: Thread n -> Bool diff --git a/doc/ghc.rst b/doc/ghc.rst index 17daaf3..dc6cd5b 100644 --- a/doc/ghc.rst +++ b/doc/ghc.rst @@ -8,7 +8,7 @@ currently supported versions are: .. csv-table:: :header: "GHC", "Stackage", "base" - "9.0", "", "4.15.0.0" + "9.0", "LTS 19.0", "4.15.0.0" "8.10", "LTS 17.0", "4.14.1.0" "8.8", "LTS 15.0", "4.13.0.0" "8.6", "LTS 13.0", "4.12.0.0" diff --git a/stack.yaml b/stack.yaml index b5a3b3e..5b23a92 100755 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-15.0 +resolver: nightly-2022-07-01 packages: - concurrency