From c057597dc307d5615f8f3427a92f703380155dc9 Mon Sep 17 00:00:00 2001 From: Janus Troelsen Date: Thu, 16 May 2024 15:59:24 -0600 Subject: [PATCH] Allow base-compat-0.14 (#1755) --- servant-client-core/servant-client-core.cabal | 2 +- servant-client-core/src/Servant/Client/Core/HasClient.hs | 3 +++ servant-client/servant-client.cabal | 2 +- servant-client/src/Servant/Client/Internal/HttpClient.hs | 6 ++++-- servant-docs/servant-docs.cabal | 2 +- servant-foreign/servant-foreign.cabal | 2 +- servant-http-streams/servant-http-streams.cabal | 2 +- servant-quickcheck/servant-quickcheck.cabal | 2 +- servant-swagger/servant-swagger.cabal | 2 +- 9 files changed, 14 insertions(+), 9 deletions(-) diff --git a/servant-client-core/servant-client-core.cabal b/servant-client-core/servant-client-core.cabal index a8207dc05..e2997acfe 100644 --- a/servant-client-core/servant-client-core.cabal +++ b/servant-client-core/servant-client-core.cabal @@ -117,7 +117,7 @@ library -- Here can be exceptions if we really need features from the newer versions. build-depends: , aeson >=1.4.1.0 && <3 - , base-compat >=0.10.5 && <0.14 + , base-compat >=0.10.5 && <0.15 , base64-bytestring >=1.0.0.1 && <1.3 , exceptions >=0.10.0 && <0.11 , free >=5.1 && <5.3 diff --git a/servant-client-core/src/Servant/Client/Core/HasClient.hs b/servant-client-core/src/Servant/Client/Core/HasClient.hs index 26670f5ed..f034d4139 100644 --- a/servant-client-core/src/Servant/Client/Core/HasClient.hs +++ b/servant-client-core/src/Servant/Client/Core/HasClient.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -Wno-missing-methods #-} module Servant.Client.Core.HasClient ( clientIn, @@ -25,8 +26,10 @@ import Data.Foldable (toList) import Data.Kind (Type) +#if !MIN_VERSION_base_compat(0,14,0) import Data.List (foldl') +#endif import Data.Sequence (fromList) import qualified Data.Text as T diff --git a/servant-client/servant-client.cabal b/servant-client/servant-client.cabal index aaf6a57bf..6cc659e68 100644 --- a/servant-client/servant-client.cabal +++ b/servant-client/servant-client.cabal @@ -112,7 +112,7 @@ library -- Other dependencies: Lower bound around what is in the latest Stackage LTS. -- Here can be exceptions if we really need features from the newer versions. build-depends: - , base-compat >=0.10.5 && <0.14 + , base-compat >=0.10.5 && <0.15 , exceptions >=0.10.0 && <0.11 , http-client >=0.5.13.1 && <0.8 , http-media >=0.7.1.3 && <0.9 diff --git a/servant-client/src/Servant/Client/Internal/HttpClient.hs b/servant-client/src/Servant/Client/Internal/HttpClient.hs index 731959de4..eb03d5840 100644 --- a/servant-client/src/Servant/Client/Internal/HttpClient.hs +++ b/servant-client/src/Servant/Client/Internal/HttpClient.hs @@ -33,8 +33,10 @@ import qualified Data.ByteString as BS import Data.ByteString.Builder (toLazyByteString) import qualified Data.ByteString.Lazy as BSL -import Data.Foldable - (foldl',toList) +#if !MIN_VERSION_base_compat(0,14,0) +import Data.Foldable (foldl') +#endif +import Data.Foldable (toList) import Data.Functor.Alt (Alt (..)) import Data.Maybe diff --git a/servant-docs/servant-docs.cabal b/servant-docs/servant-docs.cabal index 85b47dcf8..1fb488254 100644 --- a/servant-docs/servant-docs.cabal +++ b/servant-docs/servant-docs.cabal @@ -54,7 +54,7 @@ library build-depends: aeson >= 1.4.1.0 && < 3 , aeson-pretty >= 0.8.5 && < 0.9 - , base-compat >= 0.10.5 && < 0.14 + , base-compat >= 0.10.5 && < 0.15 , case-insensitive >= 1.2.0.11 && < 1.3 , hashable >= 1.2.7.0 && < 1.5 , http-media >= 0.7.1.3 && < 0.9 diff --git a/servant-foreign/servant-foreign.cabal b/servant-foreign/servant-foreign.cabal index dbcc69cb3..d6b0b23d6 100644 --- a/servant-foreign/servant-foreign.cabal +++ b/servant-foreign/servant-foreign.cabal @@ -51,7 +51,7 @@ library -- Other dependencies: Lower bound around what is in the latest Stackage LTS. -- Here can be exceptions if we really need features from the newer versions. build-depends: - base-compat >= 0.10.5 && < 0.14 + base-compat >= 0.10.5 && < 0.15 , lens >= 4.17 && < 5.3 , http-types >= 0.12.2 && < 0.13 diff --git a/servant-http-streams/servant-http-streams.cabal b/servant-http-streams/servant-http-streams.cabal index 85fec994d..64f3d04bf 100644 --- a/servant-http-streams/servant-http-streams.cabal +++ b/servant-http-streams/servant-http-streams.cabal @@ -60,7 +60,7 @@ library -- Other dependencies: Lower bound around what is in the latest Stackage LTS. -- Here can be exceptions if we really need features from the newer versions. build-depends: - base-compat >= 0.10.5 && < 0.14 + base-compat >= 0.10.5 && < 0.15 , case-insensitive , http-streams >= 0.8.6.1 && < 0.9 , http-media >= 0.7.1.3 && < 0.9 diff --git a/servant-quickcheck/servant-quickcheck.cabal b/servant-quickcheck/servant-quickcheck.cabal index fd571a475..320ac4f30 100644 --- a/servant-quickcheck/servant-quickcheck.cabal +++ b/servant-quickcheck/servant-quickcheck.cabal @@ -37,7 +37,7 @@ library build-depends: aeson >=0.8 && <2.3 , base >=4.9 && <4.20 - , base-compat-batteries >=0.10.1 && <0.14 + , base-compat-batteries >=0.10.1 && <0.15 , bytestring >=0.10 && <0.13 , case-insensitive >=1.2 && <1.3 , clock >=0.7 && <0.9 diff --git a/servant-swagger/servant-swagger.cabal b/servant-swagger/servant-swagger.cabal index cf984ea23..179197815 100644 --- a/servant-swagger/servant-swagger.cabal +++ b/servant-swagger/servant-swagger.cabal @@ -72,7 +72,7 @@ library build-depends: aeson >=1.4.2.0 && <3 , aeson-pretty >=0.8.7 && <0.9 , base >=4.9.1.0 && <5 - , base-compat >=0.10.5 && <0.14 + , base-compat >=0.10.5 && <0.15 , bytestring >=0.10.8.1 && <0.13 , http-media >=0.7.1.3 && <0.9 , insert-ordered-containers >=0.2.1.0 && <0.3