Skip to content

Commit e80d2aa

Browse files
authored
Remove base-compat dependency from servant (#1744)
* Remove base-compat dependency from servant * Reinstate CPP
1 parent 8ec6545 commit e80d2aa

File tree

7 files changed

+14
-28
lines changed

7 files changed

+14
-28
lines changed

servant/servant.cabal

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ library
100100
-- Other dependencies: Lower bound around what is in the latest Stackage LTS.
101101
-- Here can be exceptions if we really need features from the newer versions.
102102
build-depends:
103-
base-compat >= 0.10.5 && < 0.14
104-
, aeson >= 1.4.1.0 && < 2.3
103+
aeson >= 1.4.1.0 && < 2.3
105104
, attoparsec >= 0.13.2.2 && < 0.15
106105
, bifunctors >= 5.5.3 && < 5.7
107106
, case-insensitive >= 1.2.0.11 && < 1.3

servant/src/Servant/API/Alternative.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import Data.Bitraversable
1515
(Bitraversable (..))
1616
import Data.Typeable
1717
(Typeable)
18-
import Prelude ()
19-
import Prelude.Compat
2018

2119
-- | Union of two APIs, first takes precedence in case of overlap.
2220
--

servant/src/Servant/API/ContentTypes.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ module Servant.API.ContentTypes
7171

7272
import Control.Arrow
7373
(left)
74-
import Control.Monad.Compat
7574
import Control.DeepSeq
7675
(NFData)
7776
import Data.Aeson
@@ -97,8 +96,6 @@ import GHC.Generics
9796
(Generic)
9897
import qualified GHC.TypeLits as TL
9998
import qualified Network.HTTP.Media as M
100-
import Prelude ()
101-
import Prelude.Compat
10299
import Web.FormUrlEncoded
103100
(FromForm, ToForm, urlDecodeAsForm, urlEncodeAsForm)
104101

@@ -299,7 +296,7 @@ instance {-# OVERLAPPING #-} ( Accept ctyp ) => AllMimeRender '[ctyp] NoContent
299296
instance {-# OVERLAPPING #-}
300297
( AllMime (ctyp ': ctyp' ': ctyps)
301298
) => AllMimeRender (ctyp ': ctyp' ': ctyps) NoContent where
302-
allMimeRender p _ = zip (allMime p) (repeat "")
299+
allMimeRender p _ = map (, "") (allMime p)
303300

304301
--------------------------------------------------------------------------
305302
-- Check that all elements of list are instances of MimeUnrender

servant/src/Servant/API/Empty.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
{-# OPTIONS_HADDOCK not-home #-}
33
module Servant.API.Empty(EmptyAPI(..)) where
44

5-
import Data.Typeable
6-
(Typeable)
7-
import Prelude ()
8-
import Prelude.Compat
5+
import Data.Typeable (Typeable)
96

107
-- | An empty API: one which serves nothing. Morally speaking, this should be
118
-- the unit of ':<|>'. Implementors of interpretations of API types should

servant/src/Servant/API/ResponseHeaders.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
{-# LANGUAGE DeriveFunctor #-}
44
{-# LANGUAGE FlexibleContexts #-}
55
{-# LANGUAGE FlexibleInstances #-}
6-
{-# LANGUAGE GADTs #-}
76
{-# LANGUAGE FunctionalDependencies #-}
7+
{-# LANGUAGE GADTs #-}
88
{-# LANGUAGE PolyKinds #-}
99
{-# LANGUAGE ScopedTypeVariables #-}
10-
1110
{-# LANGUAGE TypeFamilyDependencies #-}
1211
{-# LANGUAGE TypeOperators #-}
1312
{-# LANGUAGE UndecidableInstances #-}
@@ -53,8 +52,6 @@ import qualified Network.HTTP.Types.Header as HTTP
5352
import Web.HttpApiData
5453
(FromHttpApiData, ToHttpApiData, parseHeader, toHeader)
5554

56-
import Prelude ()
57-
import Prelude.Compat
5855
import Servant.API.Header
5956
(Header')
6057
import Servant.API.Modifiers

servant/src/Servant/Links.hs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{-# LANGUAGE AllowAmbiguousTypes #-}
2-
{-# LANGUAGE CPP #-}
3-
{-# LANGUAGE ConstraintKinds #-}
2+
{-# LANGUAGE CPP #-}
3+
{-# LANGUAGE ConstraintKinds #-}
44
{-# LANGUAGE DataKinds #-}
55
{-# LANGUAGE FlexibleContexts #-}
66
{-# LANGUAGE FlexibleInstances #-}
77
{-# LANGUAGE InstanceSigs #-}
88
{-# LANGUAGE PolyKinds #-}
9-
{-# LANGUAGE QuantifiedConstraints #-}
9+
{-# LANGUAGE QuantifiedConstraints #-}
1010
{-# LANGUAGE ScopedTypeVariables #-}
1111
{-# LANGUAGE TypeApplications #-}
1212
{-# LANGUAGE TypeFamilies #-}
1313
{-# LANGUAGE TypeOperators #-}
1414
{-# LANGUAGE UndecidableInstances #-}
15+
1516
{-# OPTIONS_HADDOCK not-home #-}
1617
{-# LANGUAGE MultiParamTypeClasses #-}
18+
{-# OPTIONS_GHC -Wno-missing-methods #-}
1719

1820
-- | Type safe generation of internal links.
1921
--
@@ -145,8 +147,6 @@ import GHC.TypeLits
145147
(KnownSymbol, TypeError, symbolVal)
146148
import Network.URI
147149
(URI (..), escapeURIString, isUnreserved)
148-
import Prelude ()
149-
import Prelude.Compat
150150

151151
import Servant.API.Alternative
152152
((:<|>) ((:<|>)))
@@ -660,19 +660,19 @@ simpleToLink _ toA _ = toLink toA (Proxy :: Proxy sub)
660660
-- >>> import Data.Text (Text)
661661

662662
-- Erroring instance for 'HasLink' when a combinator is not fully applied
663-
instance TypeError (PartialApplication
663+
instance TypeError (PartialApplication
664664
#if __GLASGOW_HASKELL__ >= 904
665-
@(Type -> Constraint)
665+
@(Type -> Constraint)
666666
#endif
667667
HasLink arr) => HasLink ((arr :: a -> b) :> sub)
668668
where
669669
type MkLink (arr :> sub) _ = TypeError (PartialApplication (HasLink :: Type -> Constraint) arr)
670670
toLink = error "unreachable"
671671

672672
-- Erroring instances for 'HasLink' for unknown API combinators
673-
instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub
673+
instance {-# OVERLAPPABLE #-} TypeError (NoInstanceForSub
674674
#if __GLASGOW_HASKELL__ >= 904
675-
@(Type -> Constraint)
675+
@(Type -> Constraint)
676676
#endif
677677
HasLink ty) => HasLink (ty :> sub)
678678

servant/src/Servant/Types/SourceT.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ import Data.Functor.Classes
1818
(Show1 (..), showsBinaryWith, showsPrec1, showsUnaryWith)
1919
import Data.Functor.Identity
2020
(Identity (..))
21-
import Prelude ()
22-
import Prelude.Compat hiding
23-
(readFile)
21+
import Prelude hiding (readFile)
2422
import System.IO
2523
(Handle, IOMode (..), withFile)
2624
import qualified Test.QuickCheck as QC

0 commit comments

Comments
 (0)