diff --git a/CHANGELOG.md b/CHANGELOG.md index 737d568..0cf8b2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog][chg] and this project adheres to [Haskell's Package Versioning Policy][pvp] +## Unreleased + + - Address or suppress warnings + ## `1.0.0.1` - 2022-09-10 - Support GHC 9.4 by eliminating compiler errors diff --git a/src/AWS/Lambda/Events/ApiGateway/ProxyRequest.hs b/src/AWS/Lambda/Events/ApiGateway/ProxyRequest.hs index 8a333ef..900a2e5 100644 --- a/src/AWS/Lambda/Events/ApiGateway/ProxyRequest.hs +++ b/src/AWS/Lambda/Events/ApiGateway/ProxyRequest.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-| Module : AWS.Lambda.Events.ApiGateway.ProxyRequest Description : Data types that represent typical lambda responses @@ -168,10 +169,23 @@ data ProxyRequest a = ProxyRequest , body :: ByteString } deriving (Eq, Generic, Show) -toCIHashMap :: (Eq k, FoldCase k, Hashable k) => HashMap k a -> HashMap (CI k) a +toCIHashMap :: +#if !MIN_VERSION_hashable(1,4,0) + Eq k => +#endif + FoldCase k => + Hashable k => + HashMap k a -> + HashMap (CI k) a toCIHashMap = foldrWithKey (insert . mk) mempty -fromCIHashMap :: (Eq k, Hashable k) => HashMap (CI k) a -> HashMap k a +fromCIHashMap :: +#if !MIN_VERSION_hashable(1,4,0) + Eq k => +#endif + Hashable k => + HashMap (CI k) a -> + HashMap k a fromCIHashMap = foldrWithKey (insert . original) mempty toByteString :: Bool -> TL.Text -> ByteString diff --git a/src/AWS/Lambda/Events/ApiGateway/ProxyResponse.hs b/src/AWS/Lambda/Events/ApiGateway/ProxyResponse.hs index bac32d4..fbc271c 100644 --- a/src/AWS/Lambda/Events/ApiGateway/ProxyResponse.hs +++ b/src/AWS/Lambda/Events/ApiGateway/ProxyResponse.hs @@ -159,7 +159,14 @@ data ProxyResponse = ProxyResponse , body :: ProxyBody } deriving (Eq, Generic, Show) -toCIHashMap :: (Eq k, FoldCase k, Hashable k) => HashMap k a -> HashMap (CI k) a +toCIHashMap :: +#if !MIN_VERSION_hashable(1,4,0) + Eq k => +#endif + FoldCase k => + Hashable k => + HashMap k a -> + HashMap (CI k) a toCIHashMap = H.foldrWithKey (H.insert . mk) mempty -- | Smart constructor for creating a ProxyResponse from a status and a body diff --git a/test/AWS/Lambda/Events/EventBridge/Gen.hs b/test/AWS/Lambda/Events/EventBridge/Gen.hs index ceeb237..b0b2396 100644 --- a/test/AWS/Lambda/Events/EventBridge/Gen.hs +++ b/test/AWS/Lambda/Events/EventBridge/Gen.hs @@ -5,7 +5,6 @@ module AWS.Lambda.Events.EventBridge.Gen where import AWS.Lambda.Events.EventBridge (EventBridgeEvent'(..), EventBridgeEvent) -import Data.List (intersperse) import Data.Text (Text) import qualified Data.Text as T import Data.Time (UTCTime) diff --git a/test/AWS/Lambda/Events/EventBridge/Spec.hs b/test/AWS/Lambda/Events/EventBridge/Spec.hs index 8c8fba8..53ba482 100644 --- a/test/AWS/Lambda/Events/EventBridge/Spec.hs +++ b/test/AWS/Lambda/Events/EventBridge/Spec.hs @@ -16,7 +16,6 @@ import Data.Time (UTC import Hedgehog (forAll, tripping) import Test.Hspec (Spec, describe, shouldBe, specify) import Test.Hspec.Hedgehog (hedgehog) -import Test.Hspec.Runner (hspec) import Text.RawString.QQ (r) spec :: Spec diff --git a/test/Spec.hs b/test/Spec.hs index bf8ba6f..06f86af 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -237,6 +237,9 @@ minResponse headers body = , responseBody = body , responseCookieJar = undefined , responseClose' = undefined +#if MIN_VERSION_http_client(0,7,8) + , responseOriginalRequest = undefined +#endif } minJsonResponse :: [Header] -> Response Value