From 7755620e7a1be516b31000fe7f8da4b2d561a066 Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Fri, 2 Sep 2016 10:25:22 -0300 Subject: [PATCH] Review fixes --- servant-client/servant-client.cabal | 2 +- servant-server/src/Servant/Server/Internal.hs | 64 ++++++++----------- 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/servant-client/servant-client.cabal b/servant-client/servant-client.cabal index 3c356066..f03b3019 100644 --- a/servant-client/servant-client.cabal +++ b/servant-client/servant-client.cabal @@ -41,7 +41,7 @@ library , base64-bytestring >= 1.0.0.1 && < 1.1 , bytestring >= 0.10 && < 0.11 , exceptions >= 0.8 && < 0.9 - , http-api-data >= 0.1 && < 0.4 + , http-api-data >= 0.3 && < 0.4 , http-client >= 0.4.18.1 && < 0.6 , http-client-tls >= 0.2.2 && < 0.4 , http-media >= 0.6.2 && < 0.7 diff --git a/servant-server/src/Servant/Server/Internal.hs b/servant-server/src/Servant/Server/Internal.hs index 2c94ef1c..e9c51695 100644 --- a/servant-server/src/Servant/Server/Internal.hs +++ b/servant-server/src/Servant/Server/Internal.hs @@ -22,50 +22,40 @@ module Servant.Server.Internal , module Servant.Server.Internal.ServantErr ) where -import Control.Monad.Trans (liftIO) -import qualified Data.ByteString as B -import qualified Data.ByteString.Char8 as BC8 -import qualified Data.ByteString.Lazy as BL -import Data.Maybe (fromMaybe, mapMaybe) -import Data.String (fromString) -import Data.String.Conversions (cs, (<>)) +import Control.Monad.Trans (liftIO) +import qualified Data.ByteString as B +import qualified Data.ByteString.Char8 as BC8 +import qualified Data.ByteString.Lazy as BL +import Data.Maybe (fromMaybe, mapMaybe) +import Data.String (fromString) +import Data.String.Conversions (cs, (<>)) import Data.Typeable -import GHC.TypeLits (KnownNat, KnownSymbol, natVal, - symbolVal) -import Network.HTTP.Types hiding (Header, ResponseHeaders) -import Network.Socket (SockAddr) -import Network.Wai (Application, Request, Response, - httpVersion, isSecure, - lazyRequestBody, - rawQueryString, remoteHost, - requestHeaders, requestMethod, - responseLBS, vault) -import Prelude () +import GHC.TypeLits (KnownNat, KnownSymbol, natVal, + symbolVal) +import Network.HTTP.Types hiding (Header, ResponseHeaders) +import Network.Socket (SockAddr) +import Network.Wai (Application, Request, Response, + httpVersion, isSecure, + lazyRequestBody, rawQueryString, + remoteHost, requestHeaders, + requestMethod, responseLBS, vault) +import Prelude () import Prelude.Compat -import Web.HttpApiData (FromHttpApiData) -#if MIN_VERSION_http_api_data(0,3,0) -import Web.Internal.HttpApiData (parseHeaderMaybe, - parseQueryParamMaybe, - parseUrlPieceMaybe, - parseUrlPieces) -#else -import Web.HttpApiData.Internal (parseHeaderMaybe, - parseQueryParamMaybe, - parseUrlPieceMaybe, - parseUrlPieces) -#endif +import Web.HttpApiData (FromHttpApiData, parseHeaderMaybe, + parseQueryParamMaybe, + parseUrlPieceMaybe, + parseUrlPieces) -import Servant.API ((:<|>) (..), (:>), BasicAuth, Capture, - CaptureAll, Verb, - ReflectMethod(reflectMethod), - IsSecure(..), Header, QueryFlag, +import Servant.API ((:<|>) (..), (:>), BasicAuth, + Capture, CaptureAll, Header, + IsSecure (..), QueryFlag, QueryParam, QueryParams, Raw, - RemoteHost, ReqBody, Vault, + ReflectMethod (reflectMethod), + RemoteHost, ReqBody, Vault, Verb, WithNamedContext) import Servant.API.ContentTypes (AcceptHeader (..), AllCTRender (..), - AllCTUnrender (..), - AllMime, + AllCTUnrender (..), AllMime, canHandleAcceptH) import Servant.API.ResponseHeaders (GetHeaders, Headers, getHeaders, getResponse)