From 1e946cd35344133837f48e483177409029800691 Mon Sep 17 00:00:00 2001 From: Janus Troelsen Date: Thu, 7 Nov 2024 10:02:05 -0600 Subject: [PATCH] Support for building with Ghc 9.10 (with CI) (#19) * stop using old hedgehog; current version on hackage already supports 2.18 * build with ghc 9.4 * build with ghc 9.10 * use foldable1-classes-compat * remove dependency on semigroupsoids, since that is provided by foldable1-classes-compat * Update ci.yml for newer actions, GHCs * Exclude MacOS with non-native backend (e.g. LLVM) --------- Co-authored-by: Frank Staals Co-authored-by: Frank Staals <991345+noinia@users.noreply.github.com> --- .github/workflows/ci.yml | 23 ++++++++++++++++------- src/Data/Vector/Circular.hs | 6 +++--- src/Data/Vector/Circular/Generic.hs | 2 +- vector-circular.cabal | 12 ++++++------ 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a0e7d0..d833130 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,19 +13,28 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - cabal: ["3.6"] + cabal: ["3.12"] ghc: - - "8.6.5" - - "8.8.4" - "8.10.7" - "9.0.2" - - "9.2.1" + - "9.2.8" + - "9.4.8" + - "9.6.6" + - "9.8.2" + - "9.10.1" + exclude: + # Make sure we only use GHCs with the native backend + # announced in haskell.org/ghc/blog/20211029-ghc-9.2.1-released.html + - os: macos-latest + ghc: "8.10.7" + - os: macos-latest + ghc: "9.0.2" steps: - - uses: actions/checkout@v2.3.5 + - uses: actions/checkout@v4 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: haskell/actions/setup@v1 + - uses: haskell-actions/setup@v2 id: setup-haskell-cabal with: ghc-version: ${{ matrix.ghc }} @@ -35,7 +44,7 @@ jobs: run: | cabal freeze - - uses: actions/cache@v1 + - uses: actions/cache@v4 name: Cache ~/.cabal/store with: path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} diff --git a/src/Data/Vector/Circular.hs b/src/Data/Vector/Circular.hs index f7ef6f7..1f1351b 100644 --- a/src/Data/Vector/Circular.hs +++ b/src/Data/Vector/Circular.hs @@ -192,7 +192,7 @@ import Control.DeepSeq #endif /* MIN_VERSION_base(4,13,0) */ import Data.List.NonEmpty (NonEmpty((:|))) import Data.Primitive.MutVar ( newMutVar, readMutVar, writeMutVar ) -import Data.Semigroup.Foldable.Class (Foldable1) +import Data.Foldable1 (Foldable1) import Data.Monoid (All(..)) import Data.Vector (Vector) import Data.Vector.NonEmpty (NonEmptyVector) @@ -206,10 +206,10 @@ import Prelude hiding (head, length, last, map, concat, takeWhile ,foldl, foldr1, foldl1, all, any, and, or, sum ,product, maximum, minimum, concatMap ,zipWith, zipWith3, zip, zip3, replicate, enumFromTo - ,enumFromThenTo, (++), filter) + ,enumFromThenTo, (++), filter, foldl') import Language.Haskell.TH.Syntax import qualified Data.Foldable as Foldable -import qualified Data.Semigroup.Foldable.Class as Foldable1 +import qualified Data.Foldable1 as Foldable1 import qualified Data.Vector as Vector import qualified Data.Vector.Mutable as MVector import qualified Data.Vector.NonEmpty as NonEmpty diff --git a/src/Data/Vector/Circular/Generic.hs b/src/Data/Vector/Circular/Generic.hs index 772663d..3ce2393 100644 --- a/src/Data/Vector/Circular/Generic.hs +++ b/src/Data/Vector/Circular/Generic.hs @@ -202,7 +202,7 @@ import Prelude hiding (head, length, last, map, concat, takeWhile ,foldl, foldr1, foldl1, all, any, and, or, sum ,product, maximum, minimum, concatMap ,zipWith, zipWith3, zip, zip3, replicate, enumFromTo - ,enumFromThenTo, (++), filter) + ,enumFromThenTo, (++), filter, foldl') import Language.Haskell.TH.Syntax import qualified Data.Vector.Mutable as MVector import qualified Data.Vector.NonEmpty as NonEmpty diff --git a/vector-circular.cabal b/vector-circular.cabal index 8abb425..c9b7c99 100644 --- a/vector-circular.cabal +++ b/vector-circular.cabal @@ -32,13 +32,13 @@ library Data.Vector.Circular Data.Vector.Circular.Generic build-depends: - , base >= 4.11 && < 4.18 + , base >= 4.11 && < 4.21 , nonempty-vector >= 0.2 && < 0.3 - , primitive >= 0.6.4 && < 0.8 - , semigroupoids >= 5.3 && < 5.4 - , template-haskell >= 2.12 && < 2.20 - , vector >= 0.12 && < 0.13 - , deepseq >= 1.4 && < 1.5 + , primitive >= 0.6.4 && < 0.10 + , template-haskell >= 2.12 && < 2.23 + , vector >= 0.12 && < 0.14 + , deepseq >= 1.4 && < 1.6 + , foldable1-classes-compat >= 0.1 && < 0.2 ghc-options: -Wall -O2