From 1e0c1bd04369c43ab140a90310f7e1cd4c74cc3b Mon Sep 17 00:00:00 2001 From: Preetham Gujjula Date: Mon, 13 May 2024 05:10:04 -0700 Subject: [PATCH] Allow ghc-9.10 and containers-0.7 Cherry-picked from [1], and also add CPP to avoid importing foldl' from Data.List when GHC >= 9.10, since foldl' is included in Prelude. [1]: e5070836ff490686397c970f256418774b3e1175 --- apply-merge.cabal | 13 +++++++------ bench/Bench/PriorityQueue/MinPQueue.hs | 4 ++++ package.yaml | 9 +++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/apply-merge.cabal b/apply-merge.cabal index ae46532..d9fe7dd 100644 --- a/apply-merge.cabal +++ b/apply-merge.cabal @@ -22,6 +22,7 @@ tested-with: , GHC == 9.4.8 , GHC == 9.6.5 , GHC == 9.8.2 + , GHC == 9.10.1 extra-doc-files: README.md ChangeLog.md @@ -43,8 +44,8 @@ library src ghc-options: -Wall -Wunused-packages build-depends: - base >=4.16 && <4.17 || >=4.17 && <4.18 || >=4.18 && <4.19 || >=4.19 && <4.20 - , containers ==0.6.* + base >=4.16 && <4.17 || >=4.17 && <4.18 || >=4.18 && <4.19 || >=4.19 && <4.20 || >=4.20 && <4.21 + , containers >=0.6 && <0.7 || >=0.7 && <0.8 , pqueue >=1.4 && <1.5 || >=1.5 && <1.6 , reflection ==2.1.* default-language: GHC2021 @@ -74,8 +75,8 @@ test-suite apply-merge-tests test ghc-options: -Wall -Wunused-packages build-depends: - base >=4.16 && <4.17 || >=4.17 && <4.18 || >=4.18 && <4.19 || >=4.19 && <4.20 - , containers ==0.6.* + base >=4.16 && <4.17 || >=4.17 && <4.18 || >=4.18 && <4.19 || >=4.19 && <4.20 || >=4.20 && <4.21 + , containers >=0.6 && <0.7 || >=0.7 && <0.8 , data-ordlist ==0.4.* , pqueue >=1.4 && <1.5 || >=1.5 && <1.6 , reflection ==2.1.* @@ -108,8 +109,8 @@ benchmark apply-merge-benchmarks bench ghc-options: -Wall -Wunused-packages build-depends: - base >=4.16 && <4.17 || >=4.17 && <4.18 || >=4.18 && <4.19 || >=4.19 && <4.20 - , containers ==0.6.* + base >=4.16 && <4.17 || >=4.17 && <4.18 || >=4.18 && <4.19 || >=4.19 && <4.20 || >=4.20 && <4.21 + , containers >=0.6 && <0.7 || >=0.7 && <0.8 , data-ordlist ==0.4.* , pqueue >=1.4 && <1.5 || >=1.5 && <1.6 , reflection ==2.1.* diff --git a/bench/Bench/PriorityQueue/MinPQueue.hs b/bench/Bench/PriorityQueue/MinPQueue.hs index 4dd23df..6de819c 100644 --- a/bench/Bench/PriorityQueue/MinPQueue.hs +++ b/bench/Bench/PriorityQueue/MinPQueue.hs @@ -1,8 +1,12 @@ -- SPDX-FileCopyrightText: Copyright Preetham Gujjula -- SPDX-License-Identifier: BSD-3-Clause +{-# LANGUAGE CPP #-} + module Bench.PriorityQueue.MinPQueue (benchmarks) where +#if !MIN_VERSION_base(4,20,0) import Data.List (foldl') +#endif import Data.PQueue.Prio.Min (deleteMin, fromAscList, getMin, insert) import Test.Tasty.Bench (Benchmark, bench, bgroup, nf) diff --git a/package.yaml b/package.yaml index a7e46c0..dd5e7dc 100644 --- a/package.yaml +++ b/package.yaml @@ -18,6 +18,7 @@ tested-with: - GHC == 9.4.8 - GHC == 9.6.5 - GHC == 9.8.2 +- GHC == 9.10.1 extra-doc-files: - README.md @@ -33,7 +34,7 @@ ghc-options: - -Wunused-packages dependencies: -- base ^>= {4.16, 4.17, 4.18, 4.19} +- base ^>= {4.16, 4.17, 4.18, 4.19, 4.20} library: source-dirs: src @@ -43,7 +44,7 @@ library: other-modules: - ApplyMerge.IntSet dependencies: - - containers ^>= {0.6} + - containers ^>= {0.6, 0.7} - pqueue ^>= {1.4, 1.5} - reflection ^>= {2.1} @@ -64,7 +65,7 @@ tests: - test main: Main.hs dependencies: - - containers ^>= {0.6} + - containers ^>= {0.6, 0.7} - data-ordlist ^>= {0.4} - pqueue ^>= {1.4, 1.5} - reflection ^>= {2.1} @@ -82,7 +83,7 @@ benchmarks: - bench main: Main.hs dependencies: - - containers ^>= {0.6} + - containers ^>= {0.6, 0.7} - data-ordlist ^>= {0.4} - pqueue ^>= {1.4, 1.5} - reflection ^>= {2.1}