Skip to content

Commit e4ca612

Browse files
committed
Don't derive Typeable
1 parent e61e657 commit e4ca612

File tree

4 files changed

+45
-45
lines changed

4 files changed

+45
-45
lines changed

app/test-pretty-exceptions/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ wantedCompilerExamples =
293293

294294
newtype ExceptionExample
295295
= ExceptionExample Text
296-
deriving (Show, Typeable)
296+
deriving Show
297297

298298
instance Exception ExceptionExample where
299299
displayException (ExceptionExample t) = T.unpack t

int/Pantry/SHA256.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,14 @@ import qualified RIO.Text as T
5959
--
6060
-- @since 0.1.0.0
6161
newtype SHA256 = SHA256 Bytes32
62-
deriving (Generic, Eq, NFData, Data, Typeable, Ord, Hashable)
62+
deriving (Data, Eq, Generic, Hashable, NFData, Ord)
6363

6464
-- | Exceptions which can occur in this module
6565
--
6666
-- @since 0.1.0.0
6767
data SHA256Exception
6868
= InvalidByteCount !ByteString !StaticBytesException
6969
| InvalidHexBytes !ByteString !Text
70-
deriving (Typeable)
7170

7271
-- | Generate a 'SHA256' value by hashing the contents of a file.
7372
--

int/Pantry/Types.hs

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ data Package = Package
238238
--
239239
-- @since 0.1.0.0
240240
}
241-
deriving (Show, Eq, Ord)
241+
deriving (Eq, Ord, Show)
242242

243243
data PHpack = PHpack
244244
{ phOriginal :: !TreeEntry
@@ -248,12 +248,12 @@ data PHpack = PHpack
248248
, phVersion :: !Version
249249
-- ^ Version of Hpack used
250250
}
251-
deriving (Show, Eq, Ord)
251+
deriving (Eq, Ord, Show)
252252

253253
data PackageCabal
254254
= PCCabalFile !TreeEntry -- ^ TreeEntry of Cabal file
255255
| PCHpack !PHpack
256-
deriving (Show, Eq, Ord)
256+
deriving (Eq, Ord, Show)
257257

258258
cabalFileName :: PackageName -> SafeFilePath
259259
cabalFileName name =
@@ -268,7 +268,9 @@ cabalFileName name =
268268
--
269269
-- @since 0.1.0.0
270270
newtype Revision = Revision Word
271-
deriving (Generic, Show, Eq, NFData, Data, Typeable, Ord, Hashable, Display, PersistField, PersistFieldSql)
271+
deriving ( Data, Display, Eq, Generic, Hashable, NFData, Ord, PersistField
272+
, PersistFieldSql, Show
273+
)
272274

273275
-- | Represents a SQL database connection.
274276

@@ -391,7 +393,7 @@ data ResolvedPath t = ResolvedPath
391393
, resolvedAbsolute :: !(Path Abs t)
392394
-- ^ Absolute path resolved against base directory loaded from.
393395
}
394-
deriving (Show, Eq, Generic, Ord)
396+
deriving (Eq, Generic, Ord, Show)
395397

396398
instance NFData (ResolvedPath t)
397399

@@ -404,7 +406,7 @@ instance NFData (ResolvedPath t)
404406
data RawPackageLocation
405407
= RPLImmutable !RawPackageLocationImmutable
406408
| RPLMutable !(ResolvedPath Dir)
407-
deriving (Show, Eq, Generic)
409+
deriving (Eq, Generic, Show)
408410

409411
instance NFData RawPackageLocation
410412

@@ -416,7 +418,7 @@ instance NFData RawPackageLocation
416418
data PackageLocation
417419
= PLImmutable !PackageLocationImmutable
418420
| PLMutable !(ResolvedPath Dir)
419-
deriving (Show, Eq, Generic)
421+
deriving (Eq, Generic, Show)
420422

421423
instance NFData PackageLocation
422424

@@ -439,7 +441,7 @@ data RawPackageLocationImmutable
439441
= RPLIHackage !PackageIdentifierRevision !(Maybe TreeKey)
440442
| RPLIArchive !RawArchive !RawPackageMetadata
441443
| RPLIRepo !Repo !RawPackageMetadata
442-
deriving (Show, Eq, Ord, Generic)
444+
deriving (Eq, Generic, Ord, Show)
443445

444446
instance NFData RawPackageLocationImmutable
445447

@@ -507,7 +509,7 @@ data PackageLocationImmutable
507509
= PLIHackage !PackageIdentifier !BlobKey !TreeKey
508510
| PLIArchive !Archive !PackageMetadata
509511
| PLIRepo !Repo !PackageMetadata
510-
deriving (Generic, Show, Eq, Ord, Typeable)
512+
deriving (Eq, Generic, Ord, Show)
511513

512514
instance NFData PackageLocationImmutable
513515

@@ -569,7 +571,7 @@ data RawArchive = RawArchive
569571
--
570572
-- @since 0.1.0.0
571573
}
572-
deriving (Generic, Show, Eq, Ord, Typeable)
574+
deriving (Eq, Generic, Ord, Show)
573575

574576
instance NFData RawArchive
575577

@@ -596,7 +598,7 @@ data Archive = Archive
596598
--
597599
-- @since 0.1.0.0
598600
}
599-
deriving (Generic, Show, Eq, Ord, Typeable)
601+
deriving (Eq, Generic, Ord, Show)
600602

601603
instance NFData Archive
602604

@@ -612,7 +614,7 @@ toRawArchive archive =
612614
--
613615
-- @since 0.1.0.0
614616
data RepoType = RepoGit | RepoHg
615-
deriving (Generic, Show, Eq, Ord, Typeable)
617+
deriving (Eq, Generic, Ord, Show)
616618

617619
instance NFData RepoType
618620

@@ -651,7 +653,7 @@ data Repo = Repo
651653
--
652654
-- @since 0.1.0.0
653655
}
654-
deriving (Generic, Eq, Ord, Typeable)
656+
deriving (Eq, Generic, Ord)
655657

656658
instance NFData Repo
657659

@@ -682,7 +684,7 @@ data AggregateRepo = AggregateRepo
682684
{ aRepo :: !SimpleRepo
683685
, aRepoSubdirs :: [(Text, RawPackageMetadata)]
684686
}
685-
deriving (Show, Generic, Eq, Ord, Typeable)
687+
deriving (Eq, Generic, Ord, Show)
686688

687689
-- | Group input repositories by non-subdir values.
688690
toAggregateRepos :: [(Repo, RawPackageMetadata)] -> [AggregateRepo]
@@ -709,7 +711,7 @@ data SimpleRepo = SimpleRepo
709711
, sRepoCommit :: !Text
710712
, sRepoType :: !RepoType
711713
}
712-
deriving (Show, Generic, Eq, Ord, Typeable)
714+
deriving (Eq, Generic, Ord, Show)
713715

714716
instance Display SimpleRepo where
715717
display (SimpleRepo url commit typ) =
@@ -832,8 +834,8 @@ class HasPantryConfig env where
832834
--
833835
-- @since 0.1.0.0
834836
newtype FileSize = FileSize Word
835-
deriving ( Show, Eq, Ord, Typeable, Generic, Display, Hashable, NFData
836-
, PersistField, PersistFieldSql, ToJSON, FromJSON
837+
deriving ( Display, Eq, FromJSON, Generic, Hashable, NFData, Ord, PersistField
838+
, PersistFieldSql, Show, ToJSON
837839
)
838840

839841
-- | A key for looking up a blob, which combines the SHA256 hash of the contents
@@ -845,7 +847,7 @@ newtype FileSize = FileSize Word
845847
--
846848
-- @since 0.1.0.0
847849
data BlobKey = BlobKey !SHA256 !FileSize
848-
deriving (Eq, Ord, Typeable, Generic)
850+
deriving (Eq, Generic, Ord)
849851

850852
instance NFData BlobKey
851853

@@ -972,7 +974,7 @@ data CabalFileInfo
972974
-- reproducibility.
973975
--
974976
-- @since 0.1.0.0
975-
deriving (Generic, Show, Eq, Ord, Typeable)
977+
deriving (Eq, Generic, Ord, Show)
976978

977979
instance NFData CabalFileInfo
978980

@@ -990,7 +992,7 @@ instance Display CabalFileInfo where
990992
-- @since 0.1.0.0
991993
data PackageIdentifierRevision
992994
= PackageIdentifierRevision !PackageName !Version !CabalFileInfo
993-
deriving (Generic, Eq, Ord, Typeable)
995+
deriving (Eq, Generic, Ord)
994996

995997
instance NFData PackageIdentifierRevision
996998

@@ -1146,7 +1148,6 @@ data PantryException
11461148
| ParseSnapNameException !Text
11471149
| HpackLibraryException !(Path Abs File) !String
11481150
| HpackExeException !FilePath !(Path Abs Dir) !SomeException
1149-
deriving Typeable
11501151

11511152
instance Exception PantryException where
11521153

@@ -2178,10 +2179,10 @@ data BuildFile
21782179
= BFCabal !SafeFilePath !TreeEntry
21792180
| BFHpack !TreeEntry
21802181
-- We don't need SafeFilePath for Hpack since it has to be package.yaml file
2181-
deriving (Show, Eq)
2182+
deriving (Eq, Show)
21822183

21832184
data FileType = FTNormal | FTExecutable
2184-
deriving (Show, Eq, Enum, Bounded, Ord)
2185+
deriving (Bounded, Enum, Eq, Ord, Show)
21852186

21862187
instance PersistField FileType where
21872188
toPersistValue FTNormal = PersistInt64 1
@@ -2201,10 +2202,10 @@ data TreeEntry = TreeEntry
22012202
{ teBlob :: !BlobKey
22022203
, teType :: !FileType
22032204
}
2204-
deriving (Show, Eq, Ord)
2205+
deriving (Eq, Ord, Show)
22052206

22062207
newtype SafeFilePath = SafeFilePath Text
2207-
deriving (Show, Eq, Ord, Display)
2208+
deriving (Display, Eq, Ord, Show)
22082209

22092210
instance PersistField SafeFilePath where
22102211
toPersistValue = toPersistValue . unSafeFilePath
@@ -2250,7 +2251,7 @@ hpackSafeFilePath =
22502251
--
22512252
-- @since 0.1.0.0
22522253
newtype TreeKey = TreeKey BlobKey
2253-
deriving (Show, Eq, Ord, Generic, Typeable, ToJSON, FromJSON, NFData, Display)
2254+
deriving (Display, Eq, FromJSON, Generic, NFData, Ord, Show, ToJSON)
22542255

22552256
-- | Represents the contents of a tree, which is a mapping from
22562257
-- relative file paths to 'TreeEntry's.
@@ -2261,7 +2262,7 @@ newtype Tree
22612262
-- In the future, consider allowing more lax parsing
22622263
-- See: https://www.fpcomplete.com/blog/2018/07/pantry-part-2-trees-keys
22632264
-- TreeTarball !PackageTarball
2264-
deriving (Show, Eq, Ord)
2265+
deriving (Eq, Ord, Show)
22652266

22662267
renderTree :: Tree -> ByteString
22672268
renderTree = BL.toStrict . toLazyByteString . go
@@ -2460,7 +2461,7 @@ data OptionalSubdirs
24602461
= OSSubdirs !(NonEmpty Text)
24612462
| OSPackageMetadata !Text !RawPackageMetadata
24622463
-- ^ subdirectory and package metadata
2463-
deriving (Show, Eq, Generic)
2464+
deriving (Eq, Generic, Show)
24642465

24652466
instance NFData OptionalSubdirs
24662467

@@ -2483,7 +2484,7 @@ data RawPackageMetadata = RawPackageMetadata
24832484
--
24842485
-- @since 0.1.0.0
24852486
}
2486-
deriving (Show, Eq, Ord, Generic, Typeable)
2487+
deriving (Eq, Generic, Ord, Show)
24872488

24882489
instance NFData RawPackageMetadata
24892490

@@ -2507,7 +2508,7 @@ data PackageMetadata = PackageMetadata
25072508
--
25082509
-- @since 0.1.0.0
25092510
}
2510-
deriving (Show, Eq, Ord, Generic, Typeable)
2511+
deriving (Eq, Generic, Ord, Show)
25112512

25122513
-- i PackageMetadata
25132514
instance NFData PackageMetadata
@@ -2541,7 +2542,7 @@ toRawPM pm = RawPackageMetadata (Just name) (Just version) (Just $ pmTreeKey pm)
25412542
--
25422543
-- @since 0.1.0.0
25432544
newtype RelFilePath = RelFilePath Text
2544-
deriving (Show, ToJSON, FromJSON, Eq, Ord, Generic, Typeable, NFData, Display)
2545+
deriving (Display, Eq, FromJSON, Generic, NFData, Ord, Show, ToJSON)
25452546

25462547
-- | Location that an archive is stored at
25472548
--
@@ -2555,7 +2556,7 @@ data ArchiveLocation
25552556
-- ^ Archive stored at a local file path
25562557
--
25572558
-- @since 0.1.0.0
2558-
deriving (Show, Eq, Ord, Generic, Typeable)
2559+
deriving (Eq, Generic, Ord, Show)
25592560

25602561
instance NFData ArchiveLocation
25612562

@@ -2817,7 +2818,7 @@ rpmEmpty = RawPackageMetadata Nothing Nothing Nothing
28172818
--
28182819
-- @since 0.1.0.0
28192820
newtype CabalString a = CabalString { unCabalString :: a }
2820-
deriving (Show, Eq, Ord, Typeable)
2821+
deriving (Eq, Ord, Show)
28212822

28222823
-- I'd like to use coerce here, but can't due to roles. unsafeCoerce
28232824
-- could work, but let's avoid unsafe code.
@@ -2891,7 +2892,7 @@ data HpackExecutable
28912892
-- ^ Compiled in library
28922893
| HpackCommand !FilePath
28932894
-- ^ Executable at the provided path
2894-
deriving (Show, Read, Eq, Ord)
2895+
deriving (Eq, Ord, Read, Show)
28952896

28962897

28972898
-- | Which compiler a snapshot wants to use. The build tool may elect to do some
@@ -2905,7 +2906,7 @@ data WantedCompiler
29052906
!Version
29062907
!Version
29072908
-- ^ GHCJS version followed by GHC version
2908-
deriving (Show, Eq, Ord, Generic)
2909+
deriving (Eq, Generic, Ord, Show)
29092910

29102911
instance NFData WantedCompiler
29112912

@@ -3178,7 +3179,7 @@ data RawSnapshotLocation
31783179
-- ^ Snapshot synonym (LTS/Nightly).
31793180
--
31803181
-- @since 0.5.0.0
3181-
deriving (Show, Eq, Ord, Generic)
3182+
deriving (Eq, Generic, Ord, Show)
31823183

31833184
instance NFData RawSnapshotLocation
31843185

@@ -3228,7 +3229,7 @@ data SnapshotLocation
32283229
-- ^ Snapshot at a local file path.
32293230
--
32303231
-- @since 0.1.0.0
3231-
deriving (Show, Eq, Ord, Generic)
3232+
deriving (Eq, Generic, Ord, Show)
32323233

32333234
instance NFData SnapshotLocation
32343235

@@ -3360,7 +3361,7 @@ data RawSnapshotLayer = RawSnapshotLayer
33603361
--
33613362
-- @since 0.1.0.0
33623363
}
3363-
deriving (Show, Eq, Generic)
3364+
deriving (Eq, Generic, Show)
33643365

33653366
instance NFData RawSnapshotLayer
33663367

@@ -3452,7 +3453,7 @@ data SnapshotLayer = SnapshotLayer
34523453
--
34533454
-- @since 0.1.0.0
34543455
}
3455-
deriving (Show, Eq, Generic)
3456+
deriving (Eq, Generic, Show)
34563457

34573458
instance ToJSON SnapshotLayer where
34583459
toJSON snap = object $ concat
@@ -3494,7 +3495,7 @@ toRawSnapshotLayer sl = RawSnapshotLayer
34943495
--
34953496
-- @since 0.1.0.0
34963497
newtype SnapshotCacheHash = SnapshotCacheHash { unSnapshotCacheHash :: SHA256}
3497-
deriving (Show)
3498+
deriving Show
34983499

34993500
-- | Get the path to the global hints cache file
35003501
getGlobalHintsFile :: HasPantryConfig env => RIO env (Path Abs File)
@@ -3532,7 +3533,7 @@ data GlobalHintsLocation
35323533
-- ^ Download the global hints from the given URL.
35333534
| GHLFilePath !(ResolvedPath File)
35343535
-- ^ Global hints at a local file path.
3535-
deriving (Show, Eq, Ord, Generic)
3536+
deriving (Eq, Generic, Ord, Show)
35363537

35373538
instance NFData GlobalHintsLocation
35383539

src/Pantry/Storage.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ loadExposedModulePackages cacheId mName =
12141214
go (Single (P.PackageNameP m)) = m
12151215

12161216
newtype LoadCachedTreeException = MissingBlob BlobKey
1217-
deriving (Show, Typeable)
1217+
deriving Show
12181218

12191219
instance Exception LoadCachedTreeException
12201220

0 commit comments

Comments
 (0)