use base-compat

This commit is contained in:
Denis Redozubov 2016-03-01 14:21:21 +03:00
parent e34003e9af
commit c528eb24ca
7 changed files with 9 additions and 19 deletions

View file

@ -47,6 +47,7 @@ library
Servant.Utils.Links Servant.Utils.Links
build-depends: build-depends:
base >=4.7 && <5 base >=4.7 && <5
, base-compat >= 0.8
, aeson >= 0.7 , aeson >= 0.7
, attoparsec >= 0.12 , attoparsec >= 0.12
, bytestring == 0.10.* , bytestring == 0.10.*

View file

@ -9,12 +9,9 @@
{-# OPTIONS_HADDOCK not-home #-} {-# OPTIONS_HADDOCK not-home #-}
module Servant.API.Alternative ((:<|>)(..)) where module Servant.API.Alternative ((:<|>)(..)) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (Monoid (..))
import Data.Traversable (Traversable)
import Data.Foldable (Foldable)
#endif
import Data.Typeable (Typeable) import Data.Typeable (Typeable)
import Prelude.Compat (Monoid(..), Traversable, Foldable)
-- | Union of two APIs, first takes precedence in case of overlap. -- | Union of two APIs, first takes precedence in case of overlap.
-- --
-- Example: -- Example:

View file

@ -72,11 +72,8 @@ module Servant.API.ContentTypes
, canHandleAcceptH , canHandleAcceptH
) where ) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((*>), (<*))
#endif
import Control.Arrow (left) import Control.Arrow (left)
import Control.Monad import Control.Monad.Compat hiding (mapM)
import Data.Aeson (FromJSON(..), ToJSON(..), encode) import Data.Aeson (FromJSON(..), ToJSON(..), encode)
import Data.Aeson.Parser (value) import Data.Aeson.Parser (value)
import Data.Aeson.Types (parseEither) import Data.Aeson.Types (parseEither)
@ -88,7 +85,7 @@ import Data.ByteString.Lazy (ByteString, fromStrict,
import qualified Data.ByteString.Lazy as B import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString.Lazy.Char8 as BC import qualified Data.ByteString.Lazy.Char8 as BC
import Data.Maybe (isJust) import Data.Maybe (isJust)
import Data.Monoid import Data.Monoid.Compat
import Data.String.Conversions (cs) import Data.String.Conversions (cs)
import qualified Data.Text as TextS import qualified Data.Text as TextS
import qualified Data.Text.Encoding as TextS import qualified Data.Text.Encoding as TextS
@ -99,6 +96,7 @@ import GHC.Generics (Generic)
import qualified Network.HTTP.Media as M import qualified Network.HTTP.Media as M
import Network.URI (escapeURIString, import Network.URI (escapeURIString,
isUnreserved, unEscapeString) isUnreserved, unEscapeString)
import Prelude.Compat ((<*), (*>))
-- * Provided content types -- * Provided content types
data JSON deriving Typeable data JSON deriving Typeable

View file

@ -7,7 +7,6 @@
module Servant.API.Internal.Test.ComprehensiveAPI where module Servant.API.Internal.Test.ComprehensiveAPI where
import Data.Proxy import Data.Proxy
import Servant.API import Servant.API
type GET = Get '[JSON] () type GET = Get '[JSON] ()

View file

@ -30,9 +30,6 @@ module Servant.API.ResponseHeaders
, HList(..) , HList(..)
) where ) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
#endif
import Data.ByteString.Char8 as BS (pack, unlines, init) import Data.ByteString.Char8 as BS (pack, unlines, init)
import Data.ByteString.Conversion (ToByteString, toByteString', import Data.ByteString.Conversion (ToByteString, toByteString',
FromByteString, fromByteString) FromByteString, fromByteString)
@ -42,6 +39,7 @@ import GHC.TypeLits (KnownSymbol, symbolVal)
import qualified Network.HTTP.Types.Header as HTTP import qualified Network.HTTP.Types.Header as HTTP
import Servant.API.Header (Header (..)) import Servant.API.Header (Header (..))
import Prelude.Compat
-- | Response Header objects. You should never need to construct one directly. -- | Response Header objects. You should never need to construct one directly.
-- Instead, use 'addHeader'. -- Instead, use 'addHeader'.

View file

@ -105,11 +105,7 @@ import Data.List
import Data.Proxy ( Proxy(..) ) import Data.Proxy ( Proxy(..) )
import qualified Data.Text as Text import qualified Data.Text as Text
import qualified Data.ByteString.Char8 as BSC import qualified Data.ByteString.Char8 as BSC
#if !MIN_VERSION_base(4,8,0) import Data.Monoid.Compat ( Monoid(..), (<>) )
import Data.Monoid ( Monoid(..), (<>) )
#else
import Data.Monoid ( (<>) )
#endif
import Network.URI ( URI(..), escapeURIString, isUnreserved ) import Network.URI ( URI(..), escapeURIString, isUnreserved )
import GHC.TypeLits ( KnownSymbol, symbolVal ) import GHC.TypeLits ( KnownSymbol, symbolVal )
import GHC.Exts(Constraint) import GHC.Exts(Constraint)

View file

@ -12,6 +12,7 @@ packages:
- servant-mock/ - servant-mock/
- servant-server/ - servant-server/
extra-deps: extra-deps:
- base-compat-0.9.0
- hspec-2.2.0 - hspec-2.2.0
- hspec-core-2.2.0 - hspec-core-2.2.0
- hspec-discover-2.2.0 - hspec-discover-2.2.0