From a82bd1eabe94763162c2b0707d9c198fbe9835e3 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 18 Jun 2021 14:21:41 -0400 Subject: Refactored the machinery to make local macros into its own module. --- .../program/aedifex/dependency/resolution.lux | 47 +++++++++++++--------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'stdlib/source/program/aedifex/dependency') diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux index 89ad6368f..2d92e1438 100644 --- a/stdlib/source/program/aedifex/dependency/resolution.lux +++ b/stdlib/source/program/aedifex/dependency/resolution.lux @@ -196,7 +196,7 @@ failures tail resolution) - _ (do promise.monad + _ (do {! promise.monad} [?package (case (dictionary.get head resolution) (#.Some package) (wrap (#try.Success package)) @@ -205,23 +205,32 @@ (..any repositories head))] (case ?package (#try.Success package) - (let [sub_dependencies (|> package - ///package.dependencies - (try\map set.to_list) - (try.default (list))) - sub_repositories (|> package - ///package.repositories - (try\map set.to_list) - (try.default (list)) - (list\map (|>> (///repository/remote.repository #.None) - ///repository.async)) - (list\compose repositories))] - (|> resolution - (dictionary.put head package) - (recur sub_repositories - (#.Cons head successes) - failures - sub_dependencies))) + (do ! + [#let [sub_dependencies (|> package + ///package.dependencies + (try\map set.to_list) + (try.default (list))) + sub_repositories (|> package + ///package.repositories + (try\map set.to_list) + (try.default (list)) + (list\map (|>> (///repository/remote.repository #.None) + ///repository.async)) + (list\compose repositories))] + [successes failures resolution] (recur sub_repositories + (#.Cons head successes) + failures + sub_dependencies + (dictionary.put head package resolution))] + (recur repositories + successes + failures + tail + resolution)) (#try.Failure error) - (wrap [successes (#.Cons head failures) resolution]))))))) + (recur repositories + successes + (#.Cons head failures) + tail + resolution))))))) -- cgit v1.2.3