Skip to content

Commit a513156

Browse files
committed
Drop CPP conditional obsolete with base >= 4.8 (GHC 7.10)
1 parent fd748e2 commit a513156

File tree

15 files changed

+7
-156
lines changed

15 files changed

+7
-156
lines changed

hackage-repo-tool/src/Hackage/Security/RepoTool/Util/IO.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ data TarGzError = TarGzError FilePath SomeException
123123
deriving (Typeable)
124124

125125
instance Exception TarGzError where
126-
#if MIN_VERSION_base(4,8,0)
127126
displayException (TarGzError path e) = path ++ ": " ++ displayException e
128127

129128
deriving instance Show TarGzError
130-
#else
131-
instance Show TarGzError where
132-
show (TarGzError path e) = path ++ ": " ++ show e
133-
#endif

hackage-repo-tool/src/Main.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ topLevelExceptionHandler e = do
7777
putStrLn $ displayException e
7878
exitFailure
7979

80-
#if !MIN_VERSION_base(4,8,0)
81-
displayException :: Exception e => e -> String
82-
displayException = show
83-
#endif
84-
8580
{-------------------------------------------------------------------------------
8681
Creating keys
8782
-------------------------------------------------------------------------------}

hackage-root-tool/Main.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ topLevelExceptionHandler e = do
4949
putStrLn $ displayException e
5050
exitFailure
5151

52-
#if !MIN_VERSION_base(4,8,0)
53-
displayException :: Exception e => e -> String
54-
displayException = show
55-
#endif
56-
5752
{-------------------------------------------------------------------------------
5853
Creating keys
5954
-------------------------------------------------------------------------------}

hackage-security-HTTP/src/Hackage/Security/Client/Repository/HttpLib/HTTP.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,10 @@ instance Pretty UnexpectedResponse where
133133
instance Pretty InvalidProxy where
134134
pretty (InvalidProxy p) = "Invalid proxy " ++ show p
135135

136-
#if MIN_VERSION_base(4,8,0)
137136
deriving instance Show UnexpectedResponse
138137
deriving instance Show InvalidProxy
139138
instance Exception UnexpectedResponse where displayException = pretty
140139
instance Exception InvalidProxy where displayException = pretty
141-
#else
142-
instance Show UnexpectedResponse where show = pretty
143-
instance Show InvalidProxy where show = pretty
144-
instance Exception UnexpectedResponse
145-
instance Exception InvalidProxy
146-
#endif
147140

148141
{-------------------------------------------------------------------------------
149142
Additional operations

hackage-security/src/Hackage/Security/Client.hs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{-# LANGUAGE CPP #-}
2-
#if __GLASGOW_HASKELL__ >= 710
32
{-# LANGUAGE StaticPointers #-}
4-
#endif
3+
54
-- | Main entry point into the Hackage Security framework for clients
65
module Hackage.Security.Client (
76
-- * Checking for updates
@@ -952,21 +951,12 @@ data InvalidFileInIndex = forall dec. InvalidFileInIndex {
952951
}
953952
deriving (Typeable)
954953

955-
#if MIN_VERSION_base(4,8,0)
956954
deriving instance Show InvalidPackageException
957955
deriving instance Show LocalFileCorrupted
958956
deriving instance Show InvalidFileInIndex
959957
instance Exception InvalidPackageException where displayException = pretty
960958
instance Exception LocalFileCorrupted where displayException = pretty
961959
instance Exception InvalidFileInIndex where displayException = pretty
962-
#else
963-
instance Show InvalidPackageException where show = pretty
964-
instance Show LocalFileCorrupted where show = pretty
965-
instance Show InvalidFileInIndex where show = pretty
966-
instance Exception InvalidPackageException
967-
instance Exception LocalFileCorrupted
968-
instance Exception InvalidFileInIndex
969-
#endif
970960

971961
instance Pretty InvalidPackageException where
972962
pretty (InvalidPackageException pkgId) = "Invalid package " ++ display pkgId

hackage-security/src/Hackage/Security/Client/Repository.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,8 @@ data SomeRemoteError :: * where
385385
SomeRemoteError :: Exception e => e -> SomeRemoteError
386386
deriving (Typeable)
387387

388-
#if MIN_VERSION_base(4,8,0)
389388
deriving instance Show SomeRemoteError
390389
instance Exception SomeRemoteError where displayException = pretty
391-
#else
392-
instance Exception SomeRemoteError
393-
instance Show SomeRemoteError where show = pretty
394-
#endif
395390

396391
instance Pretty SomeRemoteError where
397392
pretty (SomeRemoteError ex) = displayException ex

hackage-security/src/Hackage/Security/Client/Repository/Remote.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,13 +498,8 @@ instance Pretty FileTooLarge where
498498
expected (FileSizeExact n) = "exactly " ++ show n
499499
expected (FileSizeBound n) = "at most " ++ show n
500500

501-
#if MIN_VERSION_base(4,8,0)
502501
deriving instance Show FileTooLarge
503502
instance Exception FileTooLarge where displayException = pretty
504-
#else
505-
instance Exception FileTooLarge
506-
instance Show FileTooLarge where show = pretty
507-
#endif
508503

509504
{-------------------------------------------------------------------------------
510505
Information about remote files

hackage-security/src/Hackage/Security/JSON.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,8 @@ data DeserializationError =
8484
| DeserializationErrorFileType String String
8585
deriving (Typeable)
8686

87-
#if MIN_VERSION_base(4,8,0)
8887
deriving instance Show DeserializationError
8988
instance Exception DeserializationError where displayException = pretty
90-
#else
91-
instance Show DeserializationError where show = pretty
92-
instance Exception DeserializationError
93-
#endif
9489

9590
instance Pretty DeserializationError where
9691
pretty (DeserializationErrorMalformed str) =

hackage-security/src/Hackage/Security/Key.hs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ import qualified Data.ByteString.Char8 as BS.C8
3737
import qualified Data.ByteString.Base16 as Base16
3838
import qualified Data.ByteString.Lazy as BS.L
3939

40-
#if !MIN_VERSION_base(4,7,0)
41-
import qualified Data.Typeable as Typeable
42-
#endif
43-
4440
import Hackage.Security.Util.JSON
4541
import Hackage.Security.Util.Some
4642
import Hackage.Security.Util.TypedEmbedded
@@ -277,26 +273,3 @@ instance ReportSchemaErrors m => FromJSON m (Some KeyType) where
277273
case tag of
278274
"ed25519" -> return . Some $ KeyTypeEd25519
279275
_otherwise -> expected "valid key type" (Just tag)
280-
281-
{-------------------------------------------------------------------------------
282-
Orphans
283-
284-
Pre-7.8 (base 4.7) we cannot have Typeable instance for higher-kinded types.
285-
Instead, here we provide some instance for specific instantiations.
286-
-------------------------------------------------------------------------------}
287-
288-
#if !MIN_VERSION_base(4,7,0)
289-
tyConKey, tyConPublicKey, tyConPrivateKey :: Typeable.TyCon
290-
tyConKey = Typeable.mkTyCon3 "hackage-security" "Hackage.Security.Key" "Key"
291-
tyConPublicKey = Typeable.mkTyCon3 "hackage-security" "Hackage.Security.Key" "PublicKey"
292-
tyConPrivateKey = Typeable.mkTyCon3 "hackage-security" "Hackage.Security.Key" "PrivateKey"
293-
294-
instance Typeable (Some Key) where
295-
typeOf _ = Typeable.mkTyConApp tyConSome [Typeable.mkTyConApp tyConKey []]
296-
297-
instance Typeable (Some PublicKey) where
298-
typeOf _ = Typeable.mkTyConApp tyConSome [Typeable.mkTyConApp tyConPublicKey []]
299-
300-
instance Typeable (Some PrivateKey) where
301-
typeOf _ = Typeable.mkTyConApp tyConSome [Typeable.mkTyConApp tyConPrivateKey []]
302-
#endif

hackage-security/src/Hackage/Security/Trusted.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{-# LANGUAGE CPP #-}
2-
#if __GLASGOW_HASKELL__ >= 710
32
{-# LANGUAGE StaticPointers #-}
4-
#endif
3+
54
module Hackage.Security.Trusted (
65
module Hackage.Security.Trusted.TCB
76
-- * Derived functions

0 commit comments

Comments
 (0)