on master help sign in
servant-client: use base-compat in order to use less CPP
commit79f53cef3e368e0c5d429ee15820f5986cf9adbf authorSönke Hahn <soenkehahn@gmail.com> dateSat 15 Oct 2016, 17:43 (10 years ago) parentf352f3b
5 files changed+14−16
servant-client/servant-client.cabal+2 servant-client/src/Servant/Client.hs+2−3 servant-client/src/Servant/Common/Req.hs+3−3 servant-client/test/Servant/ClientSpec.hs+5−6 servant-client/test/Servant/Common/BaseUrlSpec.hs+2−4
servant-client/servant-client.cabal+2
@@ -36,6 +36,7 @@ library
3636 Servant.Common.Req
3737 build-depends:
3838 base >= 4.7 && < 4.10
39+ , base-compat >= 0.9.1 && < 0.10
3940 , aeson >= 0.7 && < 1.1
4041 , attoparsec >= 0.12 && < 0.14
4142 , base64-bytestring >= 1.0.0.1 && < 1.1
@@ -72,6 +73,7 @@ test-suite spec
7273 , Servant.Common.BaseUrlSpec
7374 build-depends:
7475 base == 4.*
76+ , base-compat
7577 , transformers
7678 , transformers-compat
7779 , aeson
servant-client/src/Servant/Client.hs+2−3
@@ -27,9 +27,6 @@ module Servant.Client
2727 , module Servant.Common.BaseUrl
2828 ) where
2929
30−#if !MIN_VERSION_base(4,8,0)
31−import Control.Applicative ((<$>))
32−#endif
3330import Data.ByteString.Lazy (ByteString)
3431import Data.List
3532import Data.Proxy
@@ -40,6 +37,8 @@ import Network.HTTP.Client (Response)
4037import Network.HTTP.Media
4138import qualified Network.HTTP.Types as H
4239import qualified Network.HTTP.Types.Header as HTTP
40+import Prelude ()
41+import Prelude.Compat
4342import Servant.API
4443import Servant.Client.Experimental.Auth
4544import Servant.Common.BaseUrl
servant-client/src/Servant/Common/Req.hs+3−3
@@ -7,9 +7,9 @@
77
88module Servant.Common.Req where
99
10−#if !MIN_VERSION_base(4,8,0)
11−import Control.Applicative
12−#endif
10+import Prelude ()
11+import Prelude.Compat
12+
1313import Control.Exception
1414import Control.Monad
1515import Control.Monad.Catch (MonadThrow)
servant-client/test/Servant/ClientSpec.hs+5−6
@@ -10,8 +10,8 @@
1010{-# LANGUAGE OverloadedStrings #-}
1111{-# LANGUAGE PolyKinds #-}
1212{-# LANGUAGE RecordWildCards #-}
13−{-# LANGUAGE StandaloneDeriving #-}
1413{-# LANGUAGE ScopedTypeVariables #-}
14+{-# LANGUAGE StandaloneDeriving #-}
1515{-# LANGUAGE TypeFamilies #-}
1616{-# LANGUAGE TypeOperators #-}
1717{-# LANGUAGE UndecidableInstances #-}
@@ -26,9 +26,6 @@
2626#include "overlapping-compat.h"
2727module Servant.ClientSpec where
2828
29−#if !MIN_VERSION_base(4,8,0)
30−import Control.Applicative ((<$>))
31−#endif
3229import Control.Arrow (left)
3330import Control.Concurrent (forkIO, killThread, ThreadId)
3431import Control.Exception (bracket)
@@ -46,19 +43,21 @@ import qualified Network.HTTP.Types as HTTP
4643import Network.Socket
4744import Network.Wai (Request, requestHeaders, responseLBS)
4845import Network.Wai.Handler.Warp
46+import Prelude ()
47+import Prelude.Compat
4948import System.IO.Unsafe (unsafePerformIO)
49+import Test.HUnit
5050import Test.Hspec
5151import Test.Hspec.QuickCheck
52−import Test.HUnit
5352import Test.QuickCheck
5453import Web.FormUrlEncoded (FromForm, ToForm)
5554
5655import Servant.API
5756import Servant.API.Internal.Test.ComprehensiveAPI
5857import Servant.Client
58+import qualified Servant.Common.Req as SCR
5959import Servant.Server
6060import Servant.Server.Experimental.Auth
61−import qualified Servant.Common.Req as SCR
6261
6362-- This declaration simply checks that all instances are in place.
6463_ = client comprehensiveAPI
servant-client/test/Servant/Common/BaseUrlSpec.hs+2−4
@@ -1,11 +1,9 @@
1−{-# LANGUAGE CPP #-}
21{-# OPTIONS_GHC -fno-warn-orphans #-}
32module Servant.Common.BaseUrlSpec where
43
5−#if !MIN_VERSION_base(4,8,0)
6−import Control.Applicative
7−#endif
84import Control.DeepSeq
5+import Prelude ()
6+import Prelude.Compat
97import Test.Hspec
108import Test.QuickCheck
119