Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address warnings across dependency versions or redundant imports #117

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 16 additions & 2 deletions src/AWS/Lambda/Events/ApiGateway/ProxyRequest.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-|
Module : AWS.Lambda.Events.ApiGateway.ProxyRequest
Description : Data types that represent typical lambda responses
Expand Down Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion src/AWS/Lambda/Events/ApiGateway/ProxyResponse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion test/AWS/Lambda/Events/EventBridge/Gen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion test/AWS/Lambda/Events/EventBridge/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down