diff --git a/CHANGELOG.md b/CHANGELOG.md index 60dbb76..e2d1817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # resource-pool-0.5.0.0 (2025-??-??) +* Drop support for GHC < 8.10. * Use STM based lockless implementation as it results in much better throughput in a multi-threaded environment when number of stripes is not equal to the number of capabilities (in particular with a single stripe). diff --git a/resource-pool.cabal b/resource-pool.cabal index c67a090..32b8fb7 100644 --- a/resource-pool.cabal +++ b/resource-pool.cabal @@ -32,17 +32,22 @@ library Data.Pool.Internal Data.Pool.Introspection - build-depends: base >= 4.11 && < 5 + build-depends: base >= 4.14 && < 5 , hashable >= 1.1.0.0 , primitive >= 0.7 , stm , time - ghc-options: -Wall -Wcompat + ghc-options: -Wall + -Wcompat + -Wmissing-deriving-strategies + -Werror=prepositive-qualified-module default-language: Haskell2010 default-extensions: DeriveGeneric + , DerivingStrategies + , ImportQualifiedPost , LambdaCase , RankNTypes , ScopedTypeVariables diff --git a/src/Data/Pool/Internal.hs b/src/Data/Pool/Internal.hs index 2cb4062..11d35d2 100644 --- a/src/Data/Pool/Internal.hs +++ b/src/Data/Pool/Internal.hs @@ -13,7 +13,7 @@ import Control.Monad import Data.Either import Data.Hashable (hash) import Data.IORef -import qualified Data.List as L +import Data.List qualified as L import Data.Primitive.SmallArray import GHC.Clock (getMonotonicTime) import GHC.Conc (unsafeIOToSTM) diff --git a/src/Data/Pool/Introspection.hs b/src/Data/Pool/Introspection.hs index 085a367..785a358 100644 --- a/src/Data/Pool/Introspection.hs +++ b/src/Data/Pool/Introspection.hs @@ -39,7 +39,7 @@ data Resource a = Resource , acquisitionTime :: !Double , creationTime :: !(Maybe Double) } - deriving (Eq, Show, Generic) + deriving stock (Eq, Show, Generic) -- | Describes how a resource was acquired from the pool. data Acquisition @@ -47,7 +47,7 @@ data Acquisition Immediate | -- | The thread had to wait until a resource was released. Delayed - deriving (Eq, Show, Generic) + deriving stock (Eq, Show, Generic) -- | 'Data.Pool.withResource' with introspection capabilities. withResource :: Pool a -> (Resource a -> IO r) -> IO r