@@ -73,13 +73,13 @@ type instance RuleResult GetKnownTargets = KnownTargets
73
73
type instance RuleResult GenerateCore = ModGuts
74
74
75
75
data GenerateCore = GenerateCore
76
- deriving (Eq , Show , Typeable , Generic )
76
+ deriving (Eq , Ord , Show , Typeable , Generic )
77
77
instance Hashable GenerateCore
78
78
instance NFData GenerateCore
79
79
instance Binary GenerateCore
80
80
81
81
data GetImportMap = GetImportMap
82
- deriving (Eq , Show , Typeable , Generic )
82
+ deriving (Eq , Ord , Show , Typeable , Generic )
83
83
instance Hashable GetImportMap
84
84
instance NFData GetImportMap
85
85
instance Binary GetImportMap
@@ -197,7 +197,7 @@ type instance RuleResult GetModIfaceWithoutLinkable = HiFileResult
197
197
type instance RuleResult GetFileContents = (FileVersion , Maybe Text )
198
198
199
199
-- The Shake key type for getModificationTime queries
200
- data GetModificationTime = GetModificationTime_
200
+ newtype GetModificationTime = GetModificationTime_
201
201
{ missingFileDiagnostics :: Bool
202
202
-- ^ If false, missing file diagnostics are not reported
203
203
}
@@ -208,6 +208,11 @@ instance Eq GetModificationTime where
208
208
-- independent from the 'missingFileDiagnostics' field
209
209
_ == _ = True
210
210
211
+ instance Ord GetModificationTime where
212
+ -- Since the diagnostics are not part of the answer, the query identity is
213
+ -- independent from the 'missingFileDiagnostics' field
214
+ compare _ _ = EQ
215
+
211
216
instance Hashable GetModificationTime where
212
217
-- Since the diagnostics are not part of the answer, the query identity is
213
218
-- independent from the 'missingFileDiagnostics' field
@@ -236,20 +241,20 @@ vfsVersion (VFSVersion i) = Just i
236
241
vfsVersion ModificationTime {} = Nothing
237
242
238
243
data GetFileContents = GetFileContents
239
- deriving (Eq , Show , Generic )
244
+ deriving (Eq , Ord , Show , Generic )
240
245
instance Hashable GetFileContents
241
246
instance NFData GetFileContents
242
247
instance Binary GetFileContents
243
248
244
249
245
250
data FileOfInterestStatus = OnDisk | Modified
246
- deriving (Eq , Show , Typeable , Generic )
251
+ deriving (Eq , Ord , Show , Typeable , Generic )
247
252
instance Hashable FileOfInterestStatus
248
253
instance NFData FileOfInterestStatus
249
254
instance Binary FileOfInterestStatus
250
255
251
256
data IsFileOfInterestResult = NotFOI | IsFOI FileOfInterestStatus
252
- deriving (Eq , Show , Typeable , Generic )
257
+ deriving (Eq , Ord , Show , Typeable , Generic )
253
258
instance Hashable IsFileOfInterestResult
254
259
instance NFData IsFileOfInterestResult
255
260
instance Binary IsFileOfInterestResult
@@ -265,13 +270,13 @@ type instance RuleResult GetModSummary = (ModSummary,[LImportDecl GhcPs])
265
270
type instance RuleResult GetModSummaryWithoutTimestamps = (ModSummary ,[LImportDecl GhcPs ])
266
271
267
272
data GetParsedModule = GetParsedModule
268
- deriving (Eq , Show , Typeable , Generic )
273
+ deriving (Eq , Ord , Show , Typeable , Generic )
269
274
instance Hashable GetParsedModule
270
275
instance NFData GetParsedModule
271
276
instance Binary GetParsedModule
272
277
273
278
data GetLocatedImports = GetLocatedImports
274
- deriving (Eq , Show , Typeable , Generic )
279
+ deriving (Eq , Ord , Show , Typeable , Generic )
275
280
instance Hashable GetLocatedImports
276
281
instance NFData GetLocatedImports
277
282
instance Binary GetLocatedImports
@@ -280,109 +285,109 @@ instance Binary GetLocatedImports
280
285
type instance RuleResult NeedsCompilation = Bool
281
286
282
287
data NeedsCompilation = NeedsCompilation
283
- deriving (Eq , Show , Typeable , Generic )
288
+ deriving (Eq , Ord , Show , Typeable , Generic )
284
289
instance Hashable NeedsCompilation
285
290
instance NFData NeedsCompilation
286
291
instance Binary NeedsCompilation
287
292
288
293
data GetDependencyInformation = GetDependencyInformation
289
- deriving (Eq , Show , Typeable , Generic )
294
+ deriving (Eq , Ord , Show , Typeable , Generic )
290
295
instance Hashable GetDependencyInformation
291
296
instance NFData GetDependencyInformation
292
297
instance Binary GetDependencyInformation
293
298
294
299
data GetModuleGraph = GetModuleGraph
295
- deriving (Eq , Show , Typeable , Generic )
300
+ deriving (Eq , Ord , Show , Typeable , Generic )
296
301
instance Hashable GetModuleGraph
297
302
instance NFData GetModuleGraph
298
303
instance Binary GetModuleGraph
299
304
300
305
data ReportImportCycles = ReportImportCycles
301
- deriving (Eq , Show , Typeable , Generic )
306
+ deriving (Eq , Ord , Show , Typeable , Generic )
302
307
instance Hashable ReportImportCycles
303
308
instance NFData ReportImportCycles
304
309
instance Binary ReportImportCycles
305
310
306
311
data GetDependencies = GetDependencies
307
- deriving (Eq , Show , Typeable , Generic )
312
+ deriving (Eq , Ord , Show , Typeable , Generic )
308
313
instance Hashable GetDependencies
309
314
instance NFData GetDependencies
310
315
instance Binary GetDependencies
311
316
312
317
data TypeCheck = TypeCheck
313
- deriving (Eq , Show , Typeable , Generic )
318
+ deriving (Eq , Ord , Show , Typeable , Generic )
314
319
instance Hashable TypeCheck
315
320
instance NFData TypeCheck
316
321
instance Binary TypeCheck
317
322
318
323
data GetDocMap = GetDocMap
319
- deriving (Eq , Show , Typeable , Generic )
324
+ deriving (Eq , Ord , Show , Typeable , Generic )
320
325
instance Hashable GetDocMap
321
326
instance NFData GetDocMap
322
327
instance Binary GetDocMap
323
328
324
329
data GetHieAst = GetHieAst
325
- deriving (Eq , Show , Typeable , Generic )
330
+ deriving (Eq , Ord , Show , Typeable , Generic )
326
331
instance Hashable GetHieAst
327
332
instance NFData GetHieAst
328
333
instance Binary GetHieAst
329
334
330
335
data GetBindings = GetBindings
331
- deriving (Eq , Show , Typeable , Generic )
336
+ deriving (Eq , Ord , Show , Typeable , Generic )
332
337
instance Hashable GetBindings
333
338
instance NFData GetBindings
334
339
instance Binary GetBindings
335
340
336
341
data GhcSession = GhcSession
337
- deriving (Eq , Show , Typeable , Generic )
342
+ deriving (Eq , Ord , Show , Typeable , Generic )
338
343
instance Hashable GhcSession
339
344
instance NFData GhcSession
340
345
instance Binary GhcSession
341
346
342
- data GhcSessionDeps = GhcSessionDeps deriving (Eq , Show , Typeable , Generic )
347
+ data GhcSessionDeps = GhcSessionDeps deriving (Eq , Ord , Show , Typeable , Generic )
343
348
instance Hashable GhcSessionDeps
344
349
instance NFData GhcSessionDeps
345
350
instance Binary GhcSessionDeps
346
351
347
352
data GetModIfaceFromDisk = GetModIfaceFromDisk
348
- deriving (Eq , Show , Typeable , Generic )
353
+ deriving (Eq , Ord , Show , Typeable , Generic )
349
354
instance Hashable GetModIfaceFromDisk
350
355
instance NFData GetModIfaceFromDisk
351
356
instance Binary GetModIfaceFromDisk
352
357
353
358
data GetModIface = GetModIface
354
- deriving (Eq , Show , Typeable , Generic )
359
+ deriving (Eq , Ord , Show , Typeable , Generic )
355
360
instance Hashable GetModIface
356
361
instance NFData GetModIface
357
362
instance Binary GetModIface
358
363
359
364
data GetModIfaceWithoutLinkable = GetModIfaceWithoutLinkable
360
- deriving (Eq , Show , Typeable , Generic )
365
+ deriving (Eq , Ord , Show , Typeable , Generic )
361
366
instance Hashable GetModIfaceWithoutLinkable
362
367
instance NFData GetModIfaceWithoutLinkable
363
368
instance Binary GetModIfaceWithoutLinkable
364
369
365
370
data IsFileOfInterest = IsFileOfInterest
366
- deriving (Eq , Show , Typeable , Generic )
371
+ deriving (Eq , Ord , Show , Typeable , Generic )
367
372
instance Hashable IsFileOfInterest
368
373
instance NFData IsFileOfInterest
369
374
instance Binary IsFileOfInterest
370
375
371
376
data GetModSummaryWithoutTimestamps = GetModSummaryWithoutTimestamps
372
- deriving (Eq , Show , Typeable , Generic )
377
+ deriving (Eq , Ord , Show , Typeable , Generic )
373
378
instance Hashable GetModSummaryWithoutTimestamps
374
379
instance NFData GetModSummaryWithoutTimestamps
375
380
instance Binary GetModSummaryWithoutTimestamps
376
381
377
382
data GetModSummary = GetModSummary
378
- deriving (Eq , Show , Typeable , Generic )
383
+ deriving (Eq , Ord , Show , Typeable , Generic )
379
384
instance Hashable GetModSummary
380
385
instance NFData GetModSummary
381
386
instance Binary GetModSummary
382
387
383
388
-- | Get the vscode client settings stored in the ide state
384
389
data GetClientSettings = GetClientSettings
385
- deriving (Eq , Show , Typeable , Generic )
390
+ deriving (Eq , Ord , Show , Typeable , Generic )
386
391
instance Hashable GetClientSettings
387
392
instance NFData GetClientSettings
388
393
instance Binary GetClientSettings
@@ -394,7 +399,7 @@ type instance RuleResult GetClientSettings = Hashed (Maybe Value)
394
399
-- https://github.com/digital-asset/daml/pull/2808#issuecomment-529639547
395
400
type instance RuleResult GhcSessionIO = IdeGhcSession
396
401
397
- data GhcSessionIO = GhcSessionIO deriving (Eq , Show , Typeable , Generic )
402
+ data GhcSessionIO = GhcSessionIO deriving (Eq , Ord , Show , Typeable , Generic )
398
403
instance Hashable GhcSessionIO
399
404
instance NFData GhcSessionIO
400
405
instance Binary GhcSessionIO
0 commit comments