diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/tool/compiler/meta/cache/dependency.lux | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/stdlib/source/lux/tool/compiler/meta/cache/dependency.lux b/stdlib/source/lux/tool/compiler/meta/cache/dependency.lux index ec01baf45..bb3736518 100644 --- a/stdlib/source/lux/tool/compiler/meta/cache/dependency.lux +++ b/stdlib/source/lux/tool/compiler/meta/cache/dependency.lux @@ -3,29 +3,32 @@ [data ["." text] [collection - ["." list ("#;." functor fold)] - ["dict" dictionary (#+ Dictionary)]]]] + ["." list ("#@." functor fold)] + ["." dictionary (#+ Dictionary)]]]] [///io (#+ Module)] [///archive (#+ Archive)]) -(type: #export Graph (Dictionary Module (List Module))) +(type: #export Graph + (Dictionary Module (List Module))) -(def: #export empty Graph (dict.new text.hash)) +(def: #export empty + Graph + (dictionary.new text.hash)) (def: #export (add to from) (-> Module Module Graph Graph) - (|>> (dict.update~ from (list) (|>> (#.Cons to))) - (dict.update~ to (list) id))) + (|>> (dictionary.update~ from (list) (|>> (#.Cons to))) + (dictionary.update~ to (list) id))) (def: dependents - (-> Module Graph (Maybe (List Text))) - dict.get) + (-> Module Graph (Maybe (List Module))) + dictionary.get) (def: #export (remove module dependency) (-> Module Graph Graph) (case (dependents module dependency) (#.Some dependents) - (list;fold remove (dict.remove module dependency) dependents) + (list@fold remove (dictionary.remove module dependency) dependents) #.None dependency)) @@ -36,18 +39,18 @@ (def: #export (dependency [module imports]) (-> Dependency Graph) - (list;fold (..add module) ..empty imports)) + (list@fold (..add module) ..empty imports)) (def: #export graph (-> (List Dependency) Graph) - (|>> (list;map ..dependency) - (list;fold dict.merge empty))) + (|>> (list@map ..dependency) + (list@fold dictionary.merge empty))) (def: #export (prune archive graph) (-> Archive Graph Graph) - (list;fold (function (_ module graph) - (if (dict.contains? module archive) + (list@fold (function (_ module graph) + (if (dictionary.contains? module archive) graph (..remove module graph))) graph - (dict.keys graph))) + (dictionary.keys graph))) |