servant-client: use base-compat in order to use less CPP

This commit is contained in:
Sönke Hahn 2016-10-15 17:43:21 -04:00
parent f352f3b136
commit 79f53cef3e
5 changed files with 14 additions and 16 deletions

View file

@ -36,6 +36,7 @@ library
Servant.Common.Req
build-depends:
base >= 4.7 && < 4.10
, base-compat >= 0.9.1 && < 0.10
, aeson >= 0.7 && < 1.1
, attoparsec >= 0.12 && < 0.14
, base64-bytestring >= 1.0.0.1 && < 1.1
@ -72,6 +73,7 @@ test-suite spec
, Servant.Common.BaseUrlSpec
build-depends:
base == 4.*
, base-compat
, transformers
, transformers-compat
, aeson

View file

@ -27,9 +27,6 @@ module Servant.Client
, module Servant.Common.BaseUrl
) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
#endif
import Data.ByteString.Lazy (ByteString)
import Data.List
import Data.Proxy
@ -40,6 +37,8 @@ import Network.HTTP.Client (Response)
import Network.HTTP.Media
import qualified Network.HTTP.Types as H
import qualified Network.HTTP.Types.Header as HTTP
import Prelude ()
import Prelude.Compat
import Servant.API
import Servant.Client.Experimental.Auth
import Servant.Common.BaseUrl

View file

@ -7,9 +7,9 @@
module Servant.Common.Req where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative
#endif
import Prelude ()
import Prelude.Compat
import Control.Exception
import Control.Monad
import Control.Monad.Catch (MonadThrow)

View file

@ -10,8 +10,8 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
@ -26,9 +26,6 @@
#include "overlapping-compat.h"
module Servant.ClientSpec where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
#endif
import Control.Arrow (left)
import Control.Concurrent (forkIO, killThread, ThreadId)
import Control.Exception (bracket)
@ -46,19 +43,21 @@ import qualified Network.HTTP.Types as HTTP
import Network.Socket
import Network.Wai (Request, requestHeaders, responseLBS)
import Network.Wai.Handler.Warp
import Prelude ()
import Prelude.Compat
import System.IO.Unsafe (unsafePerformIO)
import Test.HUnit
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.HUnit
import Test.QuickCheck
import Web.FormUrlEncoded (FromForm, ToForm)
import Servant.API
import Servant.API.Internal.Test.ComprehensiveAPI
import Servant.Client
import qualified Servant.Common.Req as SCR
import Servant.Server
import Servant.Server.Experimental.Auth
import qualified Servant.Common.Req as SCR
-- This declaration simply checks that all instances are in place.
_ = client comprehensiveAPI

View file

@ -1,11 +1,9 @@
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Servant.Common.BaseUrlSpec where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative
#endif
import Control.DeepSeq
import Prelude ()
import Prelude.Compat
import Test.Hspec
import Test.QuickCheck