diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 52322d45..e8624eef 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.19.20250506 +# version: 0.19.20250917 # -# REGENDATA ("0.19.20250506",["github","unordered-containers.cabal"]) +# REGENDATA ("0.19.20250917",["github","unordered-containers.cabal"]) # name: Haskell-CI on: @@ -20,6 +20,9 @@ on: pull_request: branches: - master + merge_group: + branches: + - master jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} @@ -72,32 +75,12 @@ jobs: compilerVersion: 8.10.7 setup-method: ghcup allow-failure: false - - compiler: ghc-8.8.4 - compilerKind: ghc - compilerVersion: 8.8.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.6.5 - compilerKind: ghc - compilerVersion: 8.6.5 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.2.2 - compilerKind: ghc - compilerVersion: 8.2.2 - setup-method: ghcup - allow-failure: false fail-fast: false steps: - name: apt-get install run: | apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 - name: Install GHCup run: | mkdir -p "$HOME/.ghcup/bin" @@ -105,8 +88,8 @@ jobs: chmod a+x "$HOME/.ghcup/bin/ghcup" - name: Install cabal-install run: | - "$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" + "$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV" - name: Install GHC (GHCup) if: matrix.setup-method == 'ghcup' run: | @@ -182,7 +165,7 @@ jobs: chmod a+x $HOME/.cabal/bin/cabal-plan cabal-plan --version - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: path: source - name: initial cabal.project for sdist @@ -207,7 +190,11 @@ jobs: touch cabal.project.local echo "packages: ${PKGDIR_unordered_containers}" >> cabal.project echo "package unordered-containers" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package unordered-containers" >> cabal.project ; fi + if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package unordered-containers" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi cat >> cabal.project <> cabal.project.local diff --git a/Data/HashMap/Internal.hs b/Data/HashMap/Internal.hs index 339c2dd0..0bc3c4db 100644 --- a/Data/HashMap/Internal.hs +++ b/Data/HashMap/Internal.hs @@ -192,11 +192,7 @@ instance (NFData k, NFData v) => NFData (Leaf k v) where -- | @since 0.2.17.0 instance (TH.Lift k, TH.Lift v) => TH.Lift (Leaf k v) where -#if MIN_VERSION_template_haskell(2,16,0) liftTyped (L k v) = [|| L k $! v ||] -#else - lift (L k v) = [| L k $! v |] -#endif -- | @since 0.2.14.0 instance NFData k => NFData1 (Leaf k) where diff --git a/Data/HashMap/Internal/Array.hs b/Data/HashMap/Internal/Array.hs index 79cf30ba..4ba10953 100644 --- a/Data/HashMap/Internal/Array.hs +++ b/Data/HashMap/Internal/Array.hs @@ -207,18 +207,13 @@ new _n@(I# n#) b = new_ :: Int -> ST s (MArray s a) new_ n = new n undefinedElem --- | When 'Exts.shrinkSmallMutableArray#' is available, the returned array is the same as the array given, as it is shrunk in place. --- Otherwise a copy is made. +-- | The returned array is the same as the array given, as it is shrunk in place. shrink :: MArray s a -> Int -> ST s (MArray s a) -#if __GLASGOW_HASKELL__ >= 810 shrink mary _n@(I# n#) = CHECK_GT("shrink", _n, (0 :: Int)) CHECK_LE("shrink", _n, (lengthM mary)) ST $ \s -> case Exts.shrinkSmallMutableArray# (unMArray mary) n# s of s' -> (# s', mary #) -#else -shrink mary n = cloneM mary 0 n -#endif {-# INLINE shrink #-} singleton :: a -> Array a @@ -516,11 +511,7 @@ fromList' n xs0 = -- | @since 0.2.17.0 instance TH.Lift a => TH.Lift (Array a) where -#if MIN_VERSION_template_haskell(2,16,0) liftTyped ar = [|| fromList' arlen arlist ||] -#else - lift ar = [| fromList' arlen arlist |] -#endif where arlen = length ar arlist = toList ar diff --git a/Data/HashMap/Internal/Debug.hs b/Data/HashMap/Internal/Debug.hs index e09901e8..1eb09396 100644 --- a/Data/HashMap/Internal/Debug.hs +++ b/Data/HashMap/Internal/Debug.hs @@ -35,11 +35,6 @@ import Data.Semigroup (Sum (..)) import qualified Data.HashMap.Internal.Array as A - -#if !MIN_VERSION_base(4,11,0) -import Data.Semigroup (Semigroup (..)) -#endif - data Validity k = Invalid (Error k) SubHashPath | Valid deriving (Eq, Show) diff --git a/Data/HashMap/Internal/List.hs b/Data/HashMap/Internal/List.hs index 27c05f7d..ca16c65b 100644 --- a/Data/HashMap/Internal/List.hs +++ b/Data/HashMap/Internal/List.hs @@ -28,9 +28,6 @@ module Data.HashMap.Internal.List import Data.List (sortBy) import Data.Maybe (fromMaybe) -#if !MIN_VERSION_base(4,11,0) -import Data.Semigroup ((<>)) -#endif -- Note: previous implementation isPermutation = null (as // bs) -- was O(n^2) too. diff --git a/tests/Regressions.hs b/tests/Regressions.hs index 1b2d3c5c..8e86e2b7 100644 --- a/tests/Regressions.hs +++ b/tests/Regressions.hs @@ -29,12 +29,8 @@ import qualified Data.HashMap.Strict as HMS import qualified Data.HashSet as HS import qualified Test.Tasty as Tasty -#if MIN_VERSION_base(4,12,0) --- nothunks requires base >= 4.12 -#define HAVE_NOTHUNKS import qualified Data.Foldable as Foldable import NoThunks.Class (noThunksInValues) -#endif issue32 :: Assertion issue32 = assert $ isJust $ HMS.lookup 7 m' @@ -141,7 +137,6 @@ issue254Strict = do ------------------------------------------------------------------------ -- Issue #379 -#ifdef HAVE_NOTHUNKS issue379Union :: Assertion issue379Union = do @@ -167,8 +162,6 @@ issue379StrictUnionWithKey = do mThunkInfo <- noThunksInValues mempty (Foldable.toList u) assert $ isNothing mThunkInfo -#endif - -- Another key type that always collides. -- -- Note (sjakobi): The KC newtype of Int somehow can't be used to demonstrate @@ -196,8 +189,6 @@ issue379LazyUnionWith = do ------------------------------------------------------------------------ -- Issue #381 -#ifdef HAVE_NOTHUNKS - issue381mapMaybe :: Assertion issue381mapMaybe = do let m0 = HMS.fromList [(KC 1, 10), (KC 2, 20 :: Int)] @@ -212,8 +203,6 @@ issue381mapMaybeWithKey = do mThunkInfo <- noThunksInValues mempty (Foldable.toList m1) assert $ isNothing mThunkInfo -#endif - ------------------------------------------------------------------------ -- Issue #382 @@ -234,8 +223,6 @@ issue382 = do ------------------------------------------------------------------------ -- Issue #383 -#ifdef HAVE_NOTHUNKS - -- Custom Functor to prevent interference from alterF rules newtype MyIdentity a = MyIdentity a instance Functor MyIdentity where @@ -250,8 +237,6 @@ issue383 = do mThunkInfo <- noThunksInValues mempty (Foldable.toList m) assert $ isNothing mThunkInfo -#endif - ------------------------------------------------------------------------ -- Issue #420 @@ -288,22 +273,16 @@ tests = testGroup "Regression tests" , testCase "issue254 strict" issue254Strict , testGroup "issue379" [ testCase "Lazy.unionWith" issue379LazyUnionWith -#ifdef HAVE_NOTHUNKS , testCase "union" issue379Union , testCase "Strict.unionWith" issue379StrictUnionWith , testCase "Strict.unionWithKey" issue379StrictUnionWithKey -#endif ] -#ifdef HAVE_NOTHUNKS , testGroup "issue381" [ testCase "mapMaybe" issue381mapMaybe , testCase "mapMaybeWithKey" issue381mapMaybeWithKey ] -#endif , testCase "issue382" issue382 -#ifdef HAVE_NOTHUNKS , testCase "issue383" issue383 -#endif , testCase "issue420" issue420 , issue491 ] diff --git a/unordered-containers.cabal b/unordered-containers.cabal index 816c6280..b1fdc079 100644 --- a/unordered-containers.cabal +++ b/unordered-containers.cabal @@ -37,10 +37,6 @@ tested-with: || ==9.2.8 || ==9.0.2 || ==8.10.7 - || ==8.8.4 - || ==8.6.5 - || ==8.4.4 - || ==8.2.2 flag debug description: Enable debug support @@ -59,10 +55,10 @@ library Data.HashSet.Internal build-depends: - base >= 4.10 && < 5, + base >= 4.14 && < 5, deepseq >= 1.4.3, hashable >= 1.4 && < 1.6, - template-haskell < 2.24 + template-haskell >= 2.16 && < 2.24 default-language: Haskell2010 @@ -104,16 +100,13 @@ test-suite unordered-containers-tests hashable, HUnit, QuickCheck >= 2.4.0.1, + nothunks >= 0.1.3, random, tasty >= 1.4.0.3, tasty-hunit >= 0.10.0.3, tasty-quickcheck >= 0.10.1.2, unordered-containers - if impl(ghc >= 8.6) - build-depends: - nothunks >= 0.1.3 - default-language: Haskell2010 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N cpp-options: -DASSERTS @@ -135,15 +128,12 @@ benchmark benchmarks deepseq, hashable, hashmap, - mtl, random, tasty-bench >= 0.3.1, unordered-containers default-language: Haskell2010 - ghc-options: -Wall -O2 -rtsopts -with-rtsopts=-A32m - if impl(ghc >= 8.10) - ghc-options: "-with-rtsopts=-A32m --nonmoving-gc" + ghc-options: -Wall -O2 -rtsopts "-with-rtsopts=-A32m --nonmoving-gc" -- cpp-options: -DBENCH_containers_Map -DBENCH_containers_IntMap -DBENCH_hashmap_Map source-repository head