1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 13:51:44 +03:00

🔥 DeadCodeResult.

This commit is contained in:
Rob Rix 2017-12-21 16:34:06 -05:00
parent 95f3763a20
commit 5801ede0fe

View File

@ -27,9 +27,6 @@ type DeadCodeEvaluating t v
, Reader (Environment (LocationFor v) v) -- For 'MonadEnv'.
]
-- | A synonym for the result of 'DeadCodeEvaluating' to @v@.
type DeadCodeResult t v = Final (DeadCodeEvaluating t v) v
-- | Dead code analysis
evalDead :: forall v term
@ -42,7 +39,7 @@ evalDead :: forall v term
, Semigroup (Cell (LocationFor v) v)
)
=> term
-> DeadCodeResult term v
-> Final (DeadCodeEvaluating term v) v
evalDead e0 = run @(DeadCodeEvaluating term v) $ do
killAll (Dead (subterms e0))
fix (evDead (\ recur yield -> eval recur yield . project)) pure e0