@@ -511,12 +511,10 @@ instance Show k => Show (Q k) where
511
511
512
512
-- | Invariant: the 'v' must be in normal form (fully evaluated).
513
513
-- Otherwise we keep repeatedly 'rnf'ing values taken from the Shake database
514
- -- Note (MK) I am not sure why we need the ShakeValue here, maybe we
515
- -- can just remove it?
516
- data A v = A (Value v ) ShakeValue
514
+ newtype A v = A (Value v )
517
515
deriving Show
518
516
519
- instance NFData (A v ) where rnf (A v x ) = v `seq` rnf x
517
+ instance NFData (A v ) where rnf (A v) = v `seq` ()
520
518
521
519
-- In the Shake database we only store one type of key/result pairs,
522
520
-- namely Q (question) / A (answer).
@@ -526,13 +524,13 @@ type instance RuleResult (Q k) = A (RuleResult k)
526
524
-- | Return up2date results. Stale results will be ignored.
527
525
uses :: IdeRule k v
528
526
=> k -> [NormalizedFilePath ] -> Action [Maybe v ]
529
- uses key files = map (\ (A value _ ) -> currentValue value) <$> apply (map (Q . (key,)) files)
527
+ uses key files = map (\ (A value) -> currentValue value) <$> apply (map (Q . (key,)) files)
530
528
531
529
-- | Return the last computed result which might be stale.
532
530
usesWithStale :: IdeRule k v
533
531
=> k -> [NormalizedFilePath ] -> Action [Maybe (v , PositionMapping )]
534
532
usesWithStale key files = do
535
- values <- map (\ (A value _ ) -> value) <$> apply (map (Q . (key,)) files)
533
+ values <- map (\ (A value) -> value) <$> apply (map (Q . (key,)) files)
536
534
zipWithM lastValue files values
537
535
538
536
@@ -558,7 +556,7 @@ defineEarlyCutoff op = addBuiltinRule noLint noIdentity $ \(Q (key, file)) (old
558
556
case v of
559
557
-- No changes in the dependencies and we have
560
558
-- an existing result.
561
- Just v -> return $ Just $ RunResult ChangedNothing old $ A v (decodeShakeValue old)
559
+ Just v -> return $ Just $ RunResult ChangedNothing old $ A v
562
560
_ -> return Nothing
563
561
_ -> return Nothing
564
562
case val of
@@ -589,7 +587,7 @@ defineEarlyCutoff op = addBuiltinRule noLint noIdentity $ \(Q (key, file)) (old
589
587
return $ RunResult
590
588
(if eq then ChangedRecomputeSame else ChangedRecomputeDiff )
591
589
(encodeShakeValue bs) $
592
- A res bs
590
+ A res
593
591
594
592
595
593
-- | Rule type, input file
0 commit comments