From e64b6d0114c26a455e19a416b5f02a4d19dd711f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 26 Jul 2021 01:45:57 -0400 Subject: Re-named Promise to Async. --- stdlib/source/program/aedifex/command/build.lux | 56 ++++++++++++------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'stdlib/source/program/aedifex/command/build.lux') diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index 52804be43..b5df31411 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -10,7 +10,7 @@ ["." exception (#+ exception:)] ["." io (#+ IO)] [concurrency - ["." promise (#+ Promise) ("#\." monad)]]] + ["." async (#+ Async) ("#\." monad)]]] [data ["." product] ["." maybe] @@ -192,32 +192,32 @@ (template [ ] [(def: #export ( console process) - (-> (Console Promise) (Process Promise) (Promise (Try Any))) + (-> (Console Async) (Process Async) (Async (Try Any))) ## This is a very odd way of implementing this function. - ## But it's written this way because the more straightforward way (i.e. by using (try.with promise.monad)) + ## But it's written this way because the more straightforward way (i.e. by using (try.with async.monad)) ## eventually led to the function hanging/freezing. ## I'm not sure why it happened, but I got this weirder implementation to work. - (let [[read! write!] (: [(Promise (Try Any)) - (promise.Resolver (Try Any))] - (promise.promise [])) + (let [[read! write!] (: [(Async (Try Any)) + (async.Resolver (Try Any))] + (async.async [])) _ (|> (\ process []) - (promise.await (function (recur ?line) - (case ?line - (#try.Failure error) - (if (exception.match? shell.no_more_output error) - (write! (#try.Success [])) - (promise.await write! (console.write_line error console))) - - (#try.Success line) - (promise.await (function (_ outcome) - (case outcome - (#try.Failure error) - (write! (#try.Failure error)) - - (#try.Success _) - (promise.await recur - (\ process [])))) - (console.write_line line console))))) + (async.await (function (recur ?line) + (case ?line + (#try.Failure error) + (if (exception.match? shell.no_more_output error) + (write! (#try.Success [])) + (async.await write! (console.write_line error console))) + + (#try.Success line) + (async.await (function (_ outcome) + (case outcome + (#try.Failure error) + (write! (#try.Failure error)) + + (#try.Success _) + (async.await recur + (\ process [])))) + (console.write_line line console))))) io.run)] read!))] @@ -261,20 +261,20 @@ runtime))) (def: #export (do! console program fs shell resolution) - (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command [Exit Compiler Path])) + (-> (Console Async) (Program Async) (file.System Async) (Shell Async) Resolution (Command [Exit Compiler Path])) (function (_ profile) (let [target (get@ #///.target profile)] (case (get@ #///.program profile) #.None - (promise\wrap (exception.throw ..no_specified_program [])) + (async\wrap (exception.throw ..no_specified_program [])) (#.Some program_module) - (do promise.monad - [environment (program.environment promise.monad program) + (do async.monad + [environment (program.environment async.monad program) #let [home (\ program home) working_directory (\ program directory)]] (do ///action.monad - [[resolution compiler] (promise\wrap (..compiler resolution (get@ #///.compiler profile))) + [[resolution compiler] (async\wrap (..compiler resolution (get@ #///.compiler profile))) #let [host_dependencies (..host_dependencies fs home resolution) [[command compiler_params] output] (case compiler (#JVM dependency) -- cgit v1.2.3