Skip to content

Commit ed42eba

Browse files
committed
Remove all deriving (Typeable). It is done by default
1 parent f1ad15f commit ed42eba

File tree

19 files changed

+56
-66
lines changed

19 files changed

+56
-66
lines changed

ghcide/src/Development/IDE/Core/RuleTypes.hs

+28-28
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type instance RuleResult GetKnownTargets = KnownTargets
8484
type instance RuleResult GenerateCore = ModGuts
8585

8686
data GenerateCore = GenerateCore
87-
deriving (Eq, Show, Typeable, Generic)
87+
deriving (Eq, Show, Generic)
8888
instance Hashable GenerateCore
8989
instance NFData GenerateCore
9090

@@ -104,12 +104,12 @@ instance NFData LinkableResult where
104104
rnf = rwhnf
105105

106106
data GetLinkable = GetLinkable
107-
deriving (Eq, Show, Typeable, Generic)
107+
deriving (Eq, Show, Generic)
108108
instance Hashable GetLinkable
109109
instance NFData GetLinkable
110110

111111
data GetImportMap = GetImportMap
112-
deriving (Eq, Show, Typeable, Generic)
112+
deriving (Eq, Show, Generic)
113113
instance Hashable GetImportMap
114114
instance NFData GetImportMap
115115

@@ -335,13 +335,13 @@ instance Hashable GetFileContents
335335
instance NFData GetFileContents
336336

337337
data GetFileExists = GetFileExists
338-
deriving (Eq, Show, Typeable, Generic)
338+
deriving (Eq, Show, Generic)
339339

340340
instance NFData GetFileExists
341341
instance Hashable GetFileExists
342342

343343
data GetFileHash = GetFileHash
344-
deriving (Eq, Show, Typeable, Generic)
344+
deriving (Eq, Show, Generic)
345345

346346
instance NFData GetFileHash
347347
instance Hashable GetFileHash
@@ -350,15 +350,15 @@ data FileOfInterestStatus
350350
= OnDisk
351351
| Modified { firstOpen :: !Bool -- ^ was this file just opened
352352
}
353-
deriving (Eq, Show, Typeable, Generic)
353+
deriving (Eq, Show, Generic)
354354
instance Hashable FileOfInterestStatus
355355
instance NFData FileOfInterestStatus
356356

357357
instance Pretty FileOfInterestStatus where
358358
pretty = viaShow
359359

360360
data IsFileOfInterestResult = NotFOI | IsFOI FileOfInterestStatus
361-
deriving (Eq, Show, Typeable, Generic)
361+
deriving (Eq, Show, Generic)
362362
instance Hashable IsFileOfInterestResult
363363
instance NFData IsFileOfInterestResult
364364

@@ -390,60 +390,60 @@ type instance RuleResult GetModSummary = ModSummaryResult
390390
type instance RuleResult GetModSummaryWithoutTimestamps = ModSummaryResult
391391

392392
data GetParsedModule = GetParsedModule
393-
deriving (Eq, Show, Typeable, Generic)
393+
deriving (Eq, Show, Generic)
394394
instance Hashable GetParsedModule
395395
instance NFData GetParsedModule
396396

397397
data GetParsedModuleWithComments = GetParsedModuleWithComments
398-
deriving (Eq, Show, Typeable, Generic)
398+
deriving (Eq, Show, Generic)
399399
instance Hashable GetParsedModuleWithComments
400400
instance NFData GetParsedModuleWithComments
401401

402402
data GetLocatedImports = GetLocatedImports
403-
deriving (Eq, Show, Typeable, Generic)
403+
deriving (Eq, Show, Generic)
404404
instance Hashable GetLocatedImports
405405
instance NFData GetLocatedImports
406406

407407
-- | Does this module need to be compiled?
408408
type instance RuleResult NeedsCompilation = Maybe LinkableType
409409

410410
data NeedsCompilation = NeedsCompilation
411-
deriving (Eq, Show, Typeable, Generic)
411+
deriving (Eq, Show, Generic)
412412
instance Hashable NeedsCompilation
413413
instance NFData NeedsCompilation
414414

415415
data GetModuleGraph = GetModuleGraph
416-
deriving (Eq, Show, Typeable, Generic)
416+
deriving (Eq, Show, Generic)
417417
instance Hashable GetModuleGraph
418418
instance NFData GetModuleGraph
419419

420420
data ReportImportCycles = ReportImportCycles
421-
deriving (Eq, Show, Typeable, Generic)
421+
deriving (Eq, Show, Generic)
422422
instance Hashable ReportImportCycles
423423
instance NFData ReportImportCycles
424424

425425
data TypeCheck = TypeCheck
426-
deriving (Eq, Show, Typeable, Generic)
426+
deriving (Eq, Show, Generic)
427427
instance Hashable TypeCheck
428428
instance NFData TypeCheck
429429

430430
data GetDocMap = GetDocMap
431-
deriving (Eq, Show, Typeable, Generic)
431+
deriving (Eq, Show, Generic)
432432
instance Hashable GetDocMap
433433
instance NFData GetDocMap
434434

435435
data GetHieAst = GetHieAst
436-
deriving (Eq, Show, Typeable, Generic)
436+
deriving (Eq, Show, Generic)
437437
instance Hashable GetHieAst
438438
instance NFData GetHieAst
439439

440440
data GetBindings = GetBindings
441-
deriving (Eq, Show, Typeable, Generic)
441+
deriving (Eq, Show, Generic)
442442
instance Hashable GetBindings
443443
instance NFData GetBindings
444444

445445
data GhcSession = GhcSession
446-
deriving (Eq, Show, Typeable, Generic)
446+
deriving (Eq, Show, Generic)
447447
instance Hashable GhcSession
448448
instance NFData GhcSession
449449

@@ -452,7 +452,7 @@ newtype GhcSessionDeps = GhcSessionDeps_
452452
-- Required for interactive evaluation, but leads to more cache invalidations
453453
fullModSummary :: Bool
454454
}
455-
deriving newtype (Eq, Typeable, Hashable, NFData)
455+
deriving newtype (Eq, Hashable, NFData)
456456

457457
instance Show GhcSessionDeps where
458458
show (GhcSessionDeps_ False) = "GhcSessionDeps"
@@ -462,45 +462,45 @@ pattern GhcSessionDeps :: GhcSessionDeps
462462
pattern GhcSessionDeps = GhcSessionDeps_ False
463463

464464
data GetModIfaceFromDisk = GetModIfaceFromDisk
465-
deriving (Eq, Show, Typeable, Generic)
465+
deriving (Eq, Show, Generic)
466466
instance Hashable GetModIfaceFromDisk
467467
instance NFData GetModIfaceFromDisk
468468

469469
data GetModIfaceFromDiskAndIndex = GetModIfaceFromDiskAndIndex
470-
deriving (Eq, Show, Typeable, Generic)
470+
deriving (Eq, Show, Generic)
471471
instance Hashable GetModIfaceFromDiskAndIndex
472472
instance NFData GetModIfaceFromDiskAndIndex
473473

474474
data GetModIface = GetModIface
475-
deriving (Eq, Show, Typeable, Generic)
475+
deriving (Eq, Show, Generic)
476476
instance Hashable GetModIface
477477
instance NFData GetModIface
478478

479479
data IsFileOfInterest = IsFileOfInterest
480-
deriving (Eq, Show, Typeable, Generic)
480+
deriving (Eq, Show, Generic)
481481
instance Hashable IsFileOfInterest
482482
instance NFData IsFileOfInterest
483483

484484
data GetModSummaryWithoutTimestamps = GetModSummaryWithoutTimestamps
485-
deriving (Eq, Show, Typeable, Generic)
485+
deriving (Eq, Show, Generic)
486486
instance Hashable GetModSummaryWithoutTimestamps
487487
instance NFData GetModSummaryWithoutTimestamps
488488

489489
data GetModSummary = GetModSummary
490-
deriving (Eq, Show, Typeable, Generic)
490+
deriving (Eq, Show, Generic)
491491
instance Hashable GetModSummary
492492
instance NFData GetModSummary
493493

494494
-- See Note [Client configuration in Rules]
495495
-- | Get the client config stored in the ide state
496496
data GetClientSettings = GetClientSettings
497-
deriving (Eq, Show, Typeable, Generic)
497+
deriving (Eq, Show, Generic)
498498
instance Hashable GetClientSettings
499499
instance NFData GetClientSettings
500500

501501
type instance RuleResult GetClientSettings = Hashed (Maybe Value)
502502

503-
data AddWatchedFile = AddWatchedFile deriving (Eq, Show, Typeable, Generic)
503+
data AddWatchedFile = AddWatchedFile deriving (Eq, Show, Generic)
504504
instance Hashable AddWatchedFile
505505
instance NFData AddWatchedFile
506506

@@ -520,7 +520,7 @@ data IdeGhcSession = IdeGhcSession
520520
instance Show IdeGhcSession where show _ = "IdeGhcSession"
521521
instance NFData IdeGhcSession where rnf !_ = ()
522522

523-
data GhcSessionIO = GhcSessionIO deriving (Eq, Show, Typeable, Generic)
523+
data GhcSessionIO = GhcSessionIO deriving (Eq, Show, Generic)
524524
instance Hashable GhcSessionIO
525525
instance NFData GhcSessionIO
526526

ghcide/src/Development/IDE/Plugin/Completions/Types.hs

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import Data.Aeson
1616
import Data.Aeson.Types
1717
import Data.Hashable (Hashable)
1818
import Data.Text (Text)
19-
import Data.Typeable (Typeable)
2019
import Development.IDE.GHC.Compat
2120
import Development.IDE.Graph (RuleResult)
2221
import Development.IDE.Spans.Common ()
@@ -31,12 +30,12 @@ type instance RuleResult LocalCompletions = CachedCompletions
3130
type instance RuleResult NonLocalCompletions = CachedCompletions
3231

3332
data LocalCompletions = LocalCompletions
34-
deriving (Eq, Show, Typeable, Generic)
33+
deriving (Eq, Show, Generic)
3534
instance Hashable LocalCompletions
3635
instance NFData LocalCompletions
3736

3837
data NonLocalCompletions = NonLocalCompletions
39-
deriving (Eq, Show, Typeable, Generic)
38+
deriving (Eq, Show, Generic)
4039
instance Hashable NonLocalCompletions
4140
instance NFData NonLocalCompletions
4241

hie-compat/src-ghc92/Compat/HieAst.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import qualified Data.Array as A
7272
import qualified Data.ByteString as BS
7373
import qualified Data.Map as M
7474
import qualified Data.Set as S
75-
import Data.Data ( Data, Typeable )
75+
import Data.Data ( Data )
7676
import Data.Void ( Void, absurd )
7777
import Control.Monad ( forM_ )
7878
import Control.Monad.Trans.State.Strict
@@ -469,7 +469,7 @@ data PScoped a = PS (Maybe Span)
469469
Scope -- ^ use site of the pattern
470470
Scope -- ^ pattern to the right of a, not including a
471471
a
472-
deriving (Typeable, Data) -- Pattern Scope
472+
deriving (Data) -- Pattern Scope
473473

474474
{- Note [TyVar Scopes]
475475
~~~~~~~~~~~~~~~~~~~

hls-graph/src/Control/Concurrent/STM/Stats.hs

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import Control.Monad
2020
import Data.IORef
2121
import qualified Data.Map.Strict as M
2222
import Data.Time (getCurrentTime)
23-
import Data.Typeable (Typeable)
2423
import GHC.Conc (unsafeIOToSTM)
2524
import System.IO
2625
import System.IO.Unsafe
@@ -151,7 +150,6 @@ trackSTMConf (TrackSTMConf {..}) name txm = do
151150
-- 'BlockedIndefinitelyOnNamedSTM', carrying the name of the transaction and
152151
-- thus giving more helpful error messages.
153152
newtype BlockedIndefinitelyOnNamedSTM = BlockedIndefinitelyOnNamedSTM String
154-
deriving (Typeable)
155153

156154
instance Show BlockedIndefinitelyOnNamedSTM where
157155
showsPrec _ (BlockedIndefinitelyOnNamedSTM name) =

hls-graph/src/Development/IDE/Graph/Internal/Types.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ data GraphException = forall e. Exception e => GraphException {
227227
stack :: [String], -- ^ The stack of keys that led to this exception
228228
inner :: e -- ^ The underlying exception
229229
}
230-
deriving (Typeable, Exception)
230+
deriving (Exception)
231231

232232
instance Show GraphException where
233233
show GraphException{..} = unlines $
@@ -249,7 +249,7 @@ instance Show Stack where
249249
show (Stack kk _) = "Stack: " <> intercalate " -> " (map show kk)
250250

251251
newtype StackException = StackException Stack
252-
deriving (Typeable, Show)
252+
deriving (Show)
253253

254254
instance Exception StackException where
255255
fromException = fromGraphException

hls-graph/test/Example.hs

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ruleBool = addRule $ \Rule _old _mode -> do
3838

3939

4040
data CondRule = CondRule
41-
deriving (Eq, Generic, Hashable, NFData, Show, Typeable)
41+
deriving (Eq, Generic, Hashable, NFData, Show)
4242
type instance RuleResult CondRule = Bool
4343

4444

@@ -48,7 +48,7 @@ ruleCond mv = addRule $ \CondRule _old _mode -> do
4848
return $ RunResult ChangedRecomputeDiff "" r (return ())
4949

5050
data BranchedRule = BranchedRule
51-
deriving (Eq, Generic, Hashable, NFData, Show, Typeable)
51+
deriving (Eq, Generic, Hashable, NFData, Show)
5252
type instance RuleResult BranchedRule = Int
5353

5454
ruleWithCond :: Rules ()
@@ -61,7 +61,7 @@ ruleWithCond = addRule $ \BranchedRule _old _mode -> do
6161
return $ RunResult ChangedRecomputeDiff "" (2 :: Int) (return ())
6262

6363
data SubBranchRule = SubBranchRule
64-
deriving (Eq, Generic, Hashable, NFData, Show, Typeable)
64+
deriving (Eq, Generic, Hashable, NFData, Show)
6565
type instance RuleResult SubBranchRule = Int
6666

6767
ruleSubBranch :: C.MVar Int -> Rules ()
@@ -70,5 +70,5 @@ ruleSubBranch mv = addRule $ \SubBranchRule _old _mode -> do
7070
return $ RunResult ChangedRecomputeDiff "" r (return ())
7171

7272
data CountRule = CountRule
73-
deriving (Eq, Generic, Hashable, NFData, Show, Typeable)
73+
deriving (Eq, Generic, Hashable, NFData, Show)
7474
type instance RuleResult CountRule = Int

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import qualified Data.HashMap.Strict as HashMap
2020
import qualified Data.List as List
2121
import qualified Data.List.NonEmpty as NE
2222
import qualified Data.Maybe as Maybe
23+
import Data.Proxy
2324
import qualified Data.Text ()
2425
import qualified Data.Text as T
2526
import qualified Data.Text.Encoding as Encoding
2627
import Data.Text.Utf16.Rope.Mixed as Rope
27-
import Data.Typeable
2828
import Development.IDE as D
2929
import Development.IDE.Core.FileStore (getVersionedTextDoc)
3030
import Development.IDE.Core.PluginUtils
@@ -442,14 +442,14 @@ newtype OfInterestCabalVar = OfInterestCabalVar (Var (HashMap NormalizedFilePath
442442
instance Shake.IsIdeGlobal OfInterestCabalVar
443443

444444
data IsCabalFileOfInterest = IsCabalFileOfInterest
445-
deriving (Eq, Show, Typeable, Generic)
445+
deriving (Eq, Show, Generic)
446446
instance Hashable IsCabalFileOfInterest
447447
instance NFData IsCabalFileOfInterest
448448

449449
type instance RuleResult IsCabalFileOfInterest = CabalFileOfInterestResult
450450

451451
data CabalFileOfInterestResult = NotCabalFOI | IsCabalFOI FileOfInterestStatus
452-
deriving (Eq, Show, Typeable, Generic)
452+
deriving (Eq, Show, Generic)
453453
instance Hashable CabalFileOfInterestResult
454454
instance NFData CabalFileOfInterestResult
455455

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/Completion/Types.hs

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import Control.DeepSeq (NFData)
88
import Control.Lens ((^.))
99
import Data.Hashable
1010
import qualified Data.Text as T
11-
import Data.Typeable
1211
import Development.IDE as D
1312
import qualified Distribution.Fields as Syntax
1413
import qualified Distribution.PackageDescription as PD
@@ -44,7 +43,7 @@ instance Pretty Log where
4443
type instance RuleResult ParseCabalFile = PD.GenericPackageDescription
4544

4645
data ParseCabalFile = ParseCabalFile
47-
deriving (Eq, Show, Typeable, Generic)
46+
deriving (Eq, Show, Generic)
4847

4948
instance Hashable ParseCabalFile
5049

@@ -53,7 +52,7 @@ instance NFData ParseCabalFile
5352
type instance RuleResult ParseCabalFields = [Syntax.Field Syntax.Position]
5453

5554
data ParseCabalFields = ParseCabalFields
56-
deriving (Eq, Show, Typeable, Generic)
55+
deriving (Eq, Show, Generic)
5756

5857
instance Hashable ParseCabalFields
5958

@@ -62,7 +61,7 @@ instance NFData ParseCabalFields
6261
type instance RuleResult ParseCabalCommonSections = [Syntax.Field Syntax.Position]
6362

6463
data ParseCabalCommonSections = ParseCabalCommonSections
65-
deriving (Eq, Show, Typeable, Generic)
64+
deriving (Eq, Show, Generic)
6665

6766
instance Hashable ParseCabalCommonSections
6867

plugins/hls-code-range-plugin/src/Ide/Plugin/CodeRange/Rules.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import Control.Monad.Trans.Maybe (MaybeT (MaybeT),
2929
maybeToExceptT)
3030
import Control.Monad.Trans.Writer.CPS
3131
import Data.Coerce (coerce)
32-
import Data.Data (Typeable)
3332
import Data.Foldable (traverse_)
3433
import Data.Function (on, (&))
3534
import Data.Hashable
@@ -158,7 +157,7 @@ simplify r =
158157
withChildrenSimplified = r { _codeRange_children = simplify <$> _codeRange_children r }
159158

160159
data GetCodeRange = GetCodeRange
161-
deriving (Eq, Show, Typeable, Generic)
160+
deriving (Eq, Show, Generic)
162161

163162
instance Hashable GetCodeRange
164163
instance NFData GetCodeRange

0 commit comments

Comments
 (0)