1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Graph modules which don’t import, and aren’t imported by, other modules.

This commit is contained in:
Rob Rix 2018-06-22 10:33:29 -04:00
parent 47411feb73
commit 9fa1befecb

View File

@ -99,11 +99,13 @@ graphingModuleInfo :: forall term address value effects a
)
=> SubtermAlgebra Module term (TermEvaluator term address value effects a)
-> SubtermAlgebra Module term (TermEvaluator term address value effects a)
graphingModuleInfo recur m = interpose @(Modules address) pure (\ eff yield -> case eff of
Load path -> currentModule >>= appendGraph . (`connect` vertex (ModuleInfo path)) . vertex >> send eff >>= yield
Lookup path -> currentModule >>= appendGraph . (`connect` vertex (ModuleInfo path)) . vertex >> send eff >>= yield
_ -> send eff >>= yield)
(recur m)
graphingModuleInfo recur m = do
appendGraph (vertex (moduleInfo m))
interpose @(Modules address) pure (\ eff yield -> case eff of
Load path -> currentModule >>= appendGraph . (`connect` vertex (ModuleInfo path)) . vertex >> send eff >>= yield
Lookup path -> currentModule >>= appendGraph . (`connect` vertex (ModuleInfo path)) . vertex >> send eff >>= yield
_ -> send eff >>= yield)
(recur m)
packageVertex :: PackageInfo -> Vertex