diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 1a1d65aec..8d6a166ed 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.20250216 +# version: 0.19.20260102 # -# REGENDATA ("0.19.20250216",["github","--config=cabal.haskell-ci","--ghc-head","cabal.project"]) +# REGENDATA ("0.19.20260102",["github","--config=cabal.haskell-ci","--ghc-head","cabal.project"]) # 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 }} @@ -32,14 +35,19 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.12.1 + - compiler: ghc-9.14.1 + compilerKind: ghc + compilerVersion: 9.14.1 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.12.2 compilerKind: ghc - compilerVersion: 9.12.1 + compilerVersion: 9.12.2 setup-method: ghcup allow-failure: false - - compiler: ghc-9.10.1 + - compiler: ghc-9.10.3 compilerKind: ghc - compilerVersion: 9.10.1 + compilerVersion: 9.10.3 setup-method: ghcup allow-failure: false - compiler: ghc-9.8.4 @@ -101,12 +109,12 @@ jobs: - name: Install GHCup run: | mkdir -p "$HOME/.ghcup/bin" - curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup" + curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" - name: Install cabal-install run: | - "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.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: | @@ -131,7 +139,7 @@ jobs: echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" - if [ $((HCNUMVER > 91201)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi + if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} @@ -194,7 +202,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 @@ -223,9 +231,13 @@ jobs: echo "packages: ${PKGDIR_containers}" >> cabal.project echo "packages: ${PKGDIR_containers_tests}" >> cabal.project echo "package containers" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project echo "package containers-tests" >> cabal.project - echo " ghc-options: -Werror=missing-methods" >> cabal.project + echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package containers" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi + if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package containers-tests" >> 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 < [Int] -> [Int] interleave [] ys = ys +interleave xs [] = xs interleave (x:xs) (y:ys) = x : y : interleave xs ys unitValues :: [Int] -> [(Int, ())] diff --git a/containers-tests/benchmarks/IntSet.hs b/containers-tests/benchmarks/IntSet.hs index e32841d54..1772b68de 100644 --- a/containers-tests/benchmarks/IntSet.hs +++ b/containers-tests/benchmarks/IntSet.hs @@ -139,6 +139,7 @@ fromListNoinline = IS.fromList interleave :: [a] -> [a] -> [a] interleave [] ys = ys +interleave xs [] = xs interleave (x:xs) (y:ys) = x : y : interleave xs ys gen :: StdGen diff --git a/containers-tests/benchmarks/Sequence.hs b/containers-tests/benchmarks/Sequence.hs index c2ad0b19a..d2276d1c3 100644 --- a/containers-tests/benchmarks/Sequence.hs +++ b/containers-tests/benchmarks/Sequence.hs @@ -226,8 +226,7 @@ fakeDeleteAt i xs -- and rejoin the pieces in the opposite order. -- Finally getting the middle element forces the whole spine. shuffle :: [Int] -> S.Seq Int -> Int -shuffle ps s = case S.viewl (S.drop (S.length s `div` 2) (foldl' cut s ps)) of - x S.:< _ -> x +shuffle ps s = S.index (foldl' cut s ps) (S.length s `div` 2) where cut xs p = let (front, back) = S.splitAt p xs in back S.>< front stateReplicate :: Int -> S.Seq Char diff --git a/containers-tests/containers-tests.cabal b/containers-tests/containers-tests.cabal index a92741fed..57551ea42 100644 --- a/containers-tests/containers-tests.cabal +++ b/containers-tests/containers-tests.cabal @@ -27,7 +27,7 @@ extra-source-files: tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || - ==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.1 || ==9.12.1 + ==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.3 || ==9.12.2 || ==9.14.1 source-repository head type: git @@ -37,11 +37,14 @@ common deps build-depends: array >=0.4.0.0 , base >=4.10 && <5 - , deepseq >=1.2 && <1.6 + , deepseq >= 1.4.3.0 && < 1.6 , template-haskell common warnings - ghc-options: -Werror=unused-top-binds + ghc-options: + -Werror=unused-top-binds + -Werror=incomplete-patterns + -Werror=incomplete-uni-patterns common test-deps import: deps @@ -58,7 +61,6 @@ common benchmark-deps import: deps build-depends: containers-tests - , deepseq >=1.1.0.0 && <1.6 , OneTuple , tasty-bench >=0.3.1 && <0.5 @@ -295,7 +297,6 @@ benchmark lookupge-intmap hs-source-dirs: benchmarks/LookupGE main-is: IntMap.hs other-modules: LookupGE_IntMap - build-depends: containers-tests benchmark lookupge-map import: benchmark-deps, warnings @@ -304,7 +305,6 @@ benchmark lookupge-map hs-source-dirs: benchmarks/LookupGE main-is: Map.hs other-modules: LookupGE_Map - build-depends: containers-tests ghc-options: -O2 ------------------- diff --git a/containers-tests/tests/intmap-properties.hs b/containers-tests/tests/intmap-properties.hs index 4f129588d..80ee58fc5 100644 --- a/containers-tests/tests/intmap-properties.hs +++ b/containers-tests/tests/intmap-properties.hs @@ -1386,6 +1386,7 @@ prop_mergeWithKeyModel xs ys (Nothing, Just y) -> if keep_y then Just (k, y) else Nothing (Just x, Nothing) -> if keep_x then Just (k, x) else Nothing (Just x, Just y) -> (\v -> (k, v)) `fmap` f k x y + (Nothing, Nothing) -> error "impossible" -- We prevent inlining testMergeWithKey to disable the SpecConstr -- optimalization. There are too many call patterns here so several @@ -1951,14 +1952,18 @@ prop_maxViewWithKey m = case maxViewWithKey m of prop_minView :: IntMap A -> Property prop_minView m = case minView m of Nothing -> property $ null m - Just (x,m') | ~(_,x'):xs' <- toList m -> - valid m' .&&. x == x' .&&. toList m' === xs' + Just (x,m') -> valid m' .&&. kxs === (minKey, x) : toList m' + where + kxs = toList m + minKey = minimum (fmap fst kxs) prop_maxView :: IntMap A -> Property prop_maxView m = case maxView m of Nothing -> property $ null m - Just (x,m') | ~(_,x'):xs' <- toDescList m -> - valid m' .&&. x == x' .&&. toDescList m' === xs' + Just (x,m') -> valid m' .&&. kxs === (maxKey, x) : toDescList m' + where + kxs = toDescList m + maxKey = maximum (fmap fst kxs) prop_mapEither :: Fun A (Either B C) -> IntMap A -> Property prop_mapEither f m = diff --git a/containers-tests/tests/map-properties.hs b/containers-tests/tests/map-properties.hs index a05d8ce8c..798944ff2 100644 --- a/containers-tests/tests/map-properties.hs +++ b/containers-tests/tests/map-properties.hs @@ -1242,6 +1242,7 @@ prop_mergeWithKeyModel xs ys (Nothing, Just y) -> if keep_y then Just (k, y) else Nothing (Just x, Nothing) -> if keep_x then Just (k, x) else Nothing (Just x, Just y) -> (\v -> (k, v)) `fmap` f k x y + (Nothing, Nothing) -> error "impossible" -- We prevent inlining testMergeWithKey to disable the SpecConstr -- optimalization. There are too many call patterns here so several @@ -1914,14 +1915,18 @@ prop_maxViewWithKey m = case maxViewWithKey m of prop_minView :: Map Int A -> Property prop_minView m = case minView m of Nothing -> property $ null m - Just (x,m') | ~(_,x'):xs' <- toList m -> - valid m' .&&. x == x' .&&. toList m' === xs' + Just (x,m') -> valid m' .&&. kxs === (minKey, x) : toList m' + where + kxs = toList m + minKey = minimum (fmap fst kxs) prop_maxView :: Map Int A -> Property prop_maxView m = case maxView m of Nothing -> property $ null m - Just (x,m') | ~(_,x'):xs' <- toDescList m -> - valid m' .&&. x == x' .&&. toDescList m' === xs' + Just (x,m') -> valid m' .&&. kxs === (maxKey, x) : toDescList m' + where + kxs = toDescList m + maxKey = maximum (fmap fst kxs) prop_isSubmapOf :: Map Int A -> Map Int A -> Property prop_isSubmapOf m1 m2 = isSubmapOf m1 m2 === all (`elem` kys) (toList m1) diff --git a/containers/containers.cabal b/containers/containers.cabal index 35335f1c0..8b7996d48 100644 --- a/containers/containers.cabal +++ b/containers/containers.cabal @@ -30,7 +30,7 @@ extra-source-files: tested-with: GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || - ==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.1 || ==9.12.1 + ==9.4.8 || ==9.6.6 || ==9.8.4 || ==9.10.3 || ==9.12.2 || ==9.14.1 source-repository head type: git