From f7be43767ec8ef21aa106b985b7c64965b1c6206 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Mon, 6 Jan 2025 10:10:29 +1100 Subject: [PATCH] Bump dependencies (support ghc 9.12) (#516) * CI: Add ghc 9.12 to the build matrix * Remove all derived Typeable instances --- .github/workflows/ci.yml | 6 ++++-- cabal.project | 4 ++++ vector-stream/vector-stream.cabal | 2 +- vector/src/Data/Vector.hs | 3 --- vector/src/Data/Vector/Mutable.hs | 4 ---- vector/src/Data/Vector/Primitive.hs | 3 --- vector/src/Data/Vector/Primitive/Mutable.hs | 3 --- vector/src/Data/Vector/Storable.hs | 3 --- vector/src/Data/Vector/Storable/Mutable.hs | 4 ---- vector/src/Data/Vector/Strict.hs | 4 +--- vector/src/Data/Vector/Strict/Mutable.hs | 4 ---- vector/src/Data/Vector/Unboxed/Base.hs | 8 -------- vector/vector.cabal | 4 ++-- 13 files changed, 12 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 992e272b..e65e7bd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,9 @@ jobs: - { cabal: "3.12", os: ubuntu-22.04, ghc: "9.6.6" } - { cabal: "3.12", os: ubuntu-22.04, ghc: "9.6.6", flags: "-fUnsafeChecks -fInternalChecks" } - - { cabal: "3.12", os: ubuntu-22.04, ghc: "9.8.2" } + - { cabal: "3.12", os: ubuntu-22.04, ghc: "9.8.4" } - { cabal: "3.12", os: ubuntu-22.04, ghc: "9.10.1" } + - { cabal: "3.12", os: ubuntu-22.04, ghc: "9.12" } # Win - { cabal: "3.12", os: windows-latest, ghc: "8.4.4" } # OOM when building tests @@ -49,8 +50,9 @@ jobs: - { cabal: "3.12", os: macOS-latest, ghc: "9.2.8" } - { cabal: "3.12", os: macOS-latest, ghc: "9.4.8" } - { cabal: "3.12", os: macOS-latest, ghc: "9.6.6" } - - { cabal: "3.12", os: macOS-latest, ghc: "9.8.2" } + - { cabal: "3.12", os: macOS-latest, ghc: "9.8.4" } - { cabal: "3.12", os: macOS-latest, ghc: "9.10.1" } + - { cabal: "3.12", os: macOS-latest, ghc: "9.12" } fail-fast: false steps: diff --git a/cabal.project b/cabal.project index abfdfdd7..39a6325b 100644 --- a/cabal.project +++ b/cabal.project @@ -2,3 +2,7 @@ packages: vector vector-stream vector-bench-papi + +-- Always build tests +tests: True + diff --git a/vector-stream/vector-stream.cabal b/vector-stream/vector-stream.cabal index 4660d681..8cdb4663 100644 --- a/vector-stream/vector-stream.cabal +++ b/vector-stream/vector-stream.cabal @@ -50,7 +50,7 @@ Library src Build-Depends: base >= 4.9 && < 4.22 - , ghc-prim >= 0.2 && < 0.12 + , ghc-prim >= 0.2 && < 0.14 source-repository head type: git diff --git a/vector/src/Data/Vector.hs b/vector/src/Data/Vector.hs index 305397c4..991dae5a 100644 --- a/vector/src/Data/Vector.hs +++ b/vector/src/Data/Vector.hs @@ -1,6 +1,5 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} @@ -203,7 +202,6 @@ import Prelude , (>>=), (+), (-), (<), (<=), (>), (>=), (==), (/=), (&&), (.), ($) ) import Data.Functor.Classes (Eq1 (..), Ord1 (..), Read1 (..), Show1 (..)) -import Data.Typeable ( Typeable ) import Data.Data ( Data(..) ) import Text.Read ( Read(..), readListPrecDefault ) import Data.Semigroup ( Semigroup(..) ) @@ -219,7 +217,6 @@ import qualified GHC.Exts as Exts (IsList(..)) data Vector a = Vector {-# UNPACK #-} !Int {-# UNPACK #-} !Int {-# UNPACK #-} !(Array a) - deriving ( Typeable ) liftRnfV :: (a -> ()) -> Vector a -> () liftRnfV elemRnf = foldl' (\_ -> elemRnf) () diff --git a/vector/src/Data/Vector/Mutable.hs b/vector/src/Data/Vector/Mutable.hs index 48f6c761..1c3496fb 100644 --- a/vector/src/Data/Vector/Mutable.hs +++ b/vector/src/Data/Vector/Mutable.hs @@ -1,6 +1,5 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RoleAnnotations #-} @@ -82,8 +81,6 @@ import Prelude , compare, return, otherwise, error , (>>=), (+), (-), (*), (<), (>), (>=), (&&), (||), ($), (>>) ) -import Data.Typeable ( Typeable ) - #include "vector.h" type role MVector nominal representational @@ -96,7 +93,6 @@ data MVector s a = MVector { _offset :: {-# UNPACK #-} !Int , _array :: {-# UNPACK #-} !(MutableArray s a) -- ^ Underlying array } - deriving ( Typeable ) type IOVector = MVector RealWorld type STVector s = MVector s diff --git a/vector/src/Data/Vector/Primitive.hs b/vector/src/Data/Vector/Primitive.hs index 13e677d5..2d67fba7 100644 --- a/vector/src/Data/Vector/Primitive.hs +++ b/vector/src/Data/Vector/Primitive.hs @@ -1,5 +1,4 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} @@ -180,7 +179,6 @@ import Prelude , compare, mempty, mappend, mconcat, showsPrec, return, otherwise, seq, error, undefined , (+), (*), (<), (<=), (>), (>=), (==), (/=), ($!) ) -import Data.Typeable ( Typeable ) import Data.Data ( Data(..) ) import Text.Read ( Read(..), readListPrecDefault ) import Data.Semigroup ( Semigroup(..) ) @@ -206,7 +204,6 @@ unsafeCoerceVector = unsafeCoerce data Vector a = Vector {-# UNPACK #-} !Int -- ^ offset {-# UNPACK #-} !Int -- ^ length {-# UNPACK #-} !ByteArray -- ^ underlying byte array - deriving ( Typeable ) instance NFData (Vector a) where rnf (Vector _ _ _) = () diff --git a/vector/src/Data/Vector/Primitive/Mutable.hs b/vector/src/Data/Vector/Primitive/Mutable.hs index 89cea418..6501ed2f 100644 --- a/vector/src/Data/Vector/Primitive/Mutable.hs +++ b/vector/src/Data/Vector/Primitive/Mutable.hs @@ -1,5 +1,4 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RoleAnnotations #-} @@ -88,7 +87,6 @@ import Prelude , otherwise, error, undefined, div, show, maxBound , (+), (*), (<), (>), (>=), (==), (&&), (||), ($), (++) ) -import Data.Typeable ( Typeable ) import Data.Coerce import Unsafe.Coerce @@ -112,7 +110,6 @@ unsafeCoerceMVector = unsafeCoerce data MVector s a = MVector {-# UNPACK #-} !Int -- ^ offset {-# UNPACK #-} !Int -- ^ length {-# UNPACK #-} !(MutableByteArray s) -- ^ underlying mutable byte array - deriving ( Typeable ) type IOVector = MVector RealWorld type STVector s = MVector s diff --git a/vector/src/Data/Vector/Storable.hs b/vector/src/Data/Vector/Storable.hs index e37596e3..88f2332c 100644 --- a/vector/src/Data/Vector/Storable.hs +++ b/vector/src/Data/Vector/Storable.hs @@ -1,5 +1,4 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} @@ -188,7 +187,6 @@ import Prelude , compare, mempty, mappend, mconcat, showsPrec, return, seq, undefined, div , (*), (<), (<=), (>), (>=), (==), (/=), (&&), (.), ($) ) -import Data.Typeable ( Typeable ) import Data.Data ( Data(..) ) import Text.Read ( Read(..), readListPrecDefault ) import Data.Semigroup ( Semigroup(..) ) @@ -216,7 +214,6 @@ unsafeCoerceVector = unsafeCoerce -- | 'Storable'-based vectors. data Vector a = Vector {-# UNPACK #-} !Int {-# UNPACK #-} !(ForeignPtr a) - deriving ( Typeable ) instance NFData (Vector a) where rnf (Vector _ _) = () diff --git a/vector/src/Data/Vector/Storable/Mutable.hs b/vector/src/Data/Vector/Storable/Mutable.hs index 490006c2..d1ab416a 100644 --- a/vector/src/Data/Vector/Storable/Mutable.hs +++ b/vector/src/Data/Vector/Storable/Mutable.hs @@ -1,5 +1,4 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} @@ -106,8 +105,6 @@ import Prelude , return, otherwise, error, undefined, max, div, quot, maxBound, show , (-), (*), (<), (>), (>=), (==), (&&), (||), (.), ($), (++) ) -import Data.Typeable ( Typeable ) - import Data.Coerce import Unsafe.Coerce @@ -131,7 +128,6 @@ unsafeCoerceMVector = unsafeCoerce -- | Mutable 'Storable'-based vectors. data MVector s a = MVector {-# UNPACK #-} !Int {-# UNPACK #-} !(ForeignPtr a) - deriving ( Typeable ) type IOVector = MVector RealWorld type STVector s = MVector s diff --git a/vector/src/Data/Vector/Strict.hs b/vector/src/Data/Vector/Strict.hs index bcda621d..faedc2e5 100644 --- a/vector/src/Data/Vector/Strict.hs +++ b/vector/src/Data/Vector/Strict.hs @@ -1,6 +1,5 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} @@ -204,7 +203,6 @@ import Prelude , (>>=), (+), (-), (.), ($), seq) import Data.Functor.Classes (Eq1 (..), Ord1 (..), Read1 (..), Show1 (..)) -import Data.Typeable ( Typeable ) import Data.Data ( Data(..) ) import Text.Read ( Read(..), readListPrecDefault ) import Data.Semigroup ( Semigroup(..) ) @@ -218,7 +216,7 @@ import qualified GHC.Exts as Exts (IsList(..)) -- | Strict boxed vectors, supporting efficient slicing. newtype Vector a = Vector (V.Vector a) - deriving (Typeable, Foldable.Foldable, Semigroup, Monoid) + deriving (Foldable.Foldable, Semigroup, Monoid) -- NOTE: [GND for strict vector] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/vector/src/Data/Vector/Strict/Mutable.hs b/vector/src/Data/Vector/Strict/Mutable.hs index 4eadfef1..4a2fdd6f 100644 --- a/vector/src/Data/Vector/Strict/Mutable.hs +++ b/vector/src/Data/Vector/Strict/Mutable.hs @@ -1,6 +1,5 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RoleAnnotations #-} @@ -86,15 +85,12 @@ import Prelude ( Ord, Monad(..), Bool, Int, Maybe, Ordering(..) , return, ($), (<$>) ) -import Data.Typeable ( Typeable ) - #include "vector.h" type role MVector nominal representational -- | Mutable boxed vectors keyed on the monad they live in ('IO' or @'ST' s@). newtype MVector s a = MVector (MV.MVector s a) - deriving ( Typeable ) type IOVector = MVector RealWorld type STVector s = MVector s diff --git a/vector/src/Data/Vector/Unboxed/Base.hs b/vector/src/Data/Vector/Unboxed/Base.hs index 723af33b..f083eda3 100644 --- a/vector/src/Data/Vector/Unboxed/Base.hs +++ b/vector/src/Data/Vector/Unboxed/Base.hs @@ -1,7 +1,6 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DefaultSignatures #-} -{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} @@ -58,7 +57,6 @@ import Data.Complex import Data.Monoid (Dual(..),Sum(..),Product(..),All(..),Any(..)) import Data.Monoid (Alt(..)) import Data.Semigroup (Min(..),Max(..),First(..),Last(..),WrappedMonoid(..),Arg(..)) -import Data.Typeable ( Typeable ) import Data.Data ( Data(..) ) import GHC.Exts ( Down(..) ) import GHC.Generics @@ -91,12 +89,6 @@ instance NFData1 (MVector s) where liftRnf _ !_ = () #endif --- ----------------- --- Data and Typeable --- ----------------- -deriving instance Typeable Vector -deriving instance Typeable MVector - instance (Data a, Unbox a) => Data (Vector a) where gfoldl = G.gfoldl toConstr _ = G.mkVecConstr "Data.Vector.Unboxed.Vector" diff --git a/vector/vector.cabal b/vector/vector.cabal index 62e66046..30c18977 100644 --- a/vector/vector.cabal +++ b/vector/vector.cabal @@ -190,7 +190,7 @@ common tests-common , vector , primitive , random - , QuickCheck >= 2.9 && < 2.15 + , QuickCheck >= 2.9 && < 2.16 , tasty , tasty-hunit , tasty-quickcheck @@ -244,7 +244,7 @@ test-suite vector-doctest buildable: False build-depends: base -any - , doctest >=0.15 && <0.23 + , doctest >=0.15 && <0.24 , primitive >= 0.6.4.0 && < 0.10 , vector -any