1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 22:01:46 +03:00

Include the root term.

This commit is contained in:
Rob Rix 2018-03-01 17:20:59 -05:00
parent f9797594e6
commit a76027926d

View File

@ -46,7 +46,7 @@ evaluateDead term = run @(DeadCodeEvaluating term value) . runEvaluator . runDea
killAll (subterms term)
evaluateTerm term
where subterms :: (Ord a, Recursive a, Foldable (Base a)) => a -> Dead a
subterms = para (foldMap (uncurry ((<>) . point)))
subterms term = para (foldMap (uncurry ((<>) . point))) term <> point term
newtype DeadCodeEvaluation term value a = DeadCodeEvaluation { runDeadCodeEvaluation :: Evaluator (DeadCodeEvaluating term value) term value a }