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/test/aedifex/command/auto.lux | 16 ++++++------- stdlib/source/test/aedifex/command/build.lux | 12 +++++----- stdlib/source/test/aedifex/command/clean.lux | 32 +++++++++++++------------- stdlib/source/test/aedifex/command/deploy.lux | 12 +++++----- stdlib/source/test/aedifex/command/deps.lux | 4 ++-- stdlib/source/test/aedifex/command/install.lux | 22 +++++++++--------- stdlib/source/test/aedifex/command/pom.lux | 4 ++-- stdlib/source/test/aedifex/command/test.lux | 6 ++--- stdlib/source/test/aedifex/command/version.lux | 8 +++---- 9 files changed, 58 insertions(+), 58 deletions(-) (limited to 'stdlib/source/test/aedifex/command') diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux index 474a8dd1f..27b12bc42 100644 --- a/stdlib/source/test/aedifex/command/auto.lux +++ b/stdlib/source/test/aedifex/command/auto.lux @@ -11,7 +11,7 @@ ["." environment]] [concurrency ["." atom (#+ Atom)] - ["." promise (#+ Promise)]]] + ["." async (#+ Async)]]] [data ["." binary] ["." text @@ -45,15 +45,15 @@ [resolution (#+ Resolution)]]]]]) (def: (command expected_runs end_signal fs dummy_file) - (-> Nat Text (file.System Promise) file.Path + (-> Nat Text (file.System Async) file.Path [(Atom Nat) - (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command [Exit Any]))]) + (-> (Console Async) (Program Async) (file.System Async) (Shell Async) Resolution (Command [Exit Any]))]) (let [@runs (: (Atom Nat) (atom.atom 0))] [@runs (function (_ console program fs shell resolution profile) - (do {! promise.monad} - [[_ actual_runs] (promise.future (atom.update inc @runs))] + (do {! async.monad} + [[_ actual_runs] (async.future (atom.update inc @runs))] (if (n.= expected_runs actual_runs) (wrap (#try.Failure end_signal)) (do (try.with !) @@ -95,13 +95,13 @@ ($_ _.and (_.cover [/.delay] (n.> 0 /.delay)) - (wrap (do promise.monad + (wrap (do async.monad [verdict (do ///action.monad [_ (\ fs make_directory source) _ (\ fs write (binary.create 0) dummy_path) #let [[@runs command] (..command expected_runs end_signal fs dummy_path)] _ (\ watcher poll [])] - (do {! promise.monad} + (do {! async.monad} [no_dangling_process! (|> profile (set@ #///.compiler compiler) ((/.do! 1 watcher command) @@ -117,7 +117,7 @@ false)))) correct_number_of_runs! (|> @runs atom.read - promise.future + async.future (\ ! map (n.= expected_runs)))] (wrap (#try.Success (and correct_number_of_runs! no_dangling_process!)))))] diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux index 4b0960d32..3bc7f86dc 100644 --- a/stdlib/source/test/aedifex/command/build.lux +++ b/stdlib/source/test/aedifex/command/build.lux @@ -10,7 +10,7 @@ ["." try] ["." exception] [concurrency - ["." promise (#+ Promise)]] + ["." async (#+ Async)]] [parser ["." environment]]] [data @@ -159,7 +159,7 @@ with_program with_target)]] ($_ _.and - (wrap (do promise.monad + (wrap (do async.monad [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty (with_target empty_profile))] (_.cover' [/.no_specified_program] @@ -169,7 +169,7 @@ (#try.Failure error) (exception.match? /.no_specified_program error))))) - (wrap (do promise.monad + (wrap (do async.monad [outcome (/.do! (@version.echo "") (program.async (program.mock environment.empty home working_directory)) fs shell ///dependency/resolution.empty profile)] (_.cover' [/.Compiler /.no_available_compiler] (case outcome @@ -181,7 +181,7 @@ (do ! [#let [console (@version.echo "")] [compiler resolution] ..resolution] - (wrap (do promise.monad + (wrap (do async.monad [verdict (do ///action.monad [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs shell resolution @@ -203,7 +203,7 @@ (do ! [#let [console (@version.echo "")] [compiler resolution] ..resolution] - (wrap (do promise.monad + (wrap (do async.monad [verdict (do ///action.monad [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (shell.async (..bad_shell [])) resolution @@ -224,7 +224,7 @@ shell (|> (list expected/0 expected/1 expected/2) (..reader_shell ) shell.async)] - (wrap (do {! promise.monad} + (wrap (do {! async.monad} [verdict (do ///action.monad [process (shell [environment.empty working_directory "" (list "")]) _ ( console process) diff --git a/stdlib/source/test/aedifex/command/clean.lux b/stdlib/source/test/aedifex/command/clean.lux index f0a5f4b58..568c6fb76 100644 --- a/stdlib/source/test/aedifex/command/clean.lux +++ b/stdlib/source/test/aedifex/command/clean.lux @@ -7,7 +7,7 @@ [control ["." try (#+ Try)] [concurrency - ["." promise (#+ Promise)]]] + ["." async (#+ Async)]]] [data [binary (#+ Binary)] ["." product] @@ -46,32 +46,32 @@ [count (\ ! map (n.% 10) random.nat) names (random.set text.hash count ..node_name) contents (random.list count ($binary.random 100))] - (wrap (list.zip/2 (list\map (|>> (format prefix)) (set.to_list names)) - contents)))) + (wrap (list.zipped/2 (list\map (|>> (format prefix)) (set.to_list names)) + contents)))) (def: (create_file! fs [path content]) - (-> (file.System Promise) [Path Binary] (Promise (Try Any))) + (-> (file.System Async) [Path Binary] (Async (Try Any))) (\ fs write content path)) (def: (create_directory! fs path files) - (-> (file.System Promise) Path (List [Path Binary]) (Promise (Try Any))) - (do {! (try.with promise.monad)} - [_ (: (Promise (Try Any)) - (file.make_directories promise.monad fs path)) + (-> (file.System Async) Path (List [Path Binary]) (Async (Try Any))) + (do {! (try.with async.monad)} + [_ (: (Async (Try Any)) + (file.make_directories async.monad fs path)) _ (monad.map ! (..create_file! fs) files)] (wrap []))) (def: (directory_exists? fs) - (-> (file.System Promise) Path (Promise (Try Bit))) - (|>> (\ fs directory?) (try.lift promise.monad))) + (-> (file.System Async) Path (Async (Try Bit))) + (|>> (\ fs directory?) (try.lift async.monad))) (def: (file_exists? fs) - (-> (file.System Promise) Path (Promise (Try Bit))) - (|>> (\ fs file?) (try.lift promise.monad))) + (-> (file.System Async) Path (Async (Try Bit))) + (|>> (\ fs file?) (try.lift async.monad))) (def: (assets_exist? fs directory_path files) - (-> (file.System Promise) Path (List [Path Binary]) (Promise (Try Bit))) - (do {! (try.with promise.monad)} + (-> (file.System Async) Path (List [Path Binary]) (Async (Try Bit))) + (do {! (try.with async.monad)} [directory_exists? (..directory_exists? fs directory_path) files_exist? (: (Action (List Bit)) (|> files @@ -95,9 +95,9 @@ sub_files (..files (format sub_path /)) dummy @profile.random] - (wrap (do promise.monad + (wrap (do async.monad [#let [console (@version.echo "")] - verdict (do {! (try.with promise.monad)} + verdict (do {! (try.with async.monad)} [_ (..create_directory! fs target_path direct_files) _ (..create_directory! fs sub_path sub_files) context_exists!/pre (..directory_exists? fs context) diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux index d1b955c77..e2f7cfa4a 100644 --- a/stdlib/source/test/aedifex/command/deploy.lux +++ b/stdlib/source/test/aedifex/command/deploy.lux @@ -7,7 +7,7 @@ [control ["." try (#+ Try)] [concurrency - ["." promise (#+ Promise)]] + ["." async (#+ Async)]] [parser ["." environment]]] [data @@ -50,9 +50,9 @@ ["#/." extension]]]]]) (def: (execute! program repository fs artifact profile) - (-> (Program Promise) (Repository Promise) (file.System Promise) + (-> (Program Async) (Repository Async) (file.System Async) Artifact ///.Profile - (Promise (Try Text))) + (Async (Try Text))) (do ///action.monad [#let [console ($version.echo "")] _ ($install.make_sources! fs (get@ #///.sources profile)) @@ -77,7 +77,7 @@ $repository.empty) fs (file.mock (\ file.default separator)) program (program.async (program.mock environment.empty home working_directory))]] - (wrap (do {! promise.monad} + (wrap (do {! async.monad} [verdict (do {! ///action.monad} [logging (..execute! program repository fs artifact profile) expected_library (|> profile @@ -89,12 +89,12 @@ actual_pom (\ repository download (///repository/remote.uri (get@ #///artifact.version artifact) artifact ///artifact/extension.pom)) actual_library (\ repository download (///repository/remote.uri (get@ #///artifact.version artifact) artifact ///artifact/extension.lux_library)) actual_sha-1 (\ repository download (///repository/remote.uri (get@ #///artifact.version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.sha-1))) - actual_sha-1 (\ promise.monad wrap + actual_sha-1 (\ async.monad wrap (do try.monad [actual_sha-1 (\ utf8.codec decode actual_sha-1)] (\ ///hash.sha-1_codec decode actual_sha-1))) actual_md5 (\ repository download (///repository/remote.uri (get@ #///artifact.version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.md5))) - actual_md5 (\ promise.monad wrap + actual_md5 (\ async.monad wrap (do try.monad [actual_md5 (\ utf8.codec decode actual_md5)] (\ ///hash.md5_codec decode actual_md5))) diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux index 40645b731..1a54ae89d 100644 --- a/stdlib/source/test/aedifex/command/deps.lux +++ b/stdlib/source/test/aedifex/command/deps.lux @@ -8,7 +8,7 @@ [control ["." try] [concurrency - ["." promise]] + ["." async]] [parser ["." environment]]] [data @@ -95,7 +95,7 @@ fs (file.mock (\ file.default separator)) program (program.async (program.mock environment.empty home working_directory))]] - (wrap (do promise.monad + (wrap (do async.monad [verdict (do ///action.monad [#let [console (@version.echo "") local (///repository/local.repository program fs)] diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux index 70df9b7a3..3ba225206 100644 --- a/stdlib/source/test/aedifex/command/install.lux +++ b/stdlib/source/test/aedifex/command/install.lux @@ -8,7 +8,7 @@ ["." try (#+ Try) ("#\." functor)] ["." exception] [concurrency - ["." promise (#+ Promise)]] + ["." async (#+ Async)]] [parser ["." environment]]] [data @@ -40,20 +40,20 @@ ["#/." local]]]]]]) (def: #export (make_sources! fs sources) - (-> (file.System Promise) (Set file.Path) (Action (List Any))) + (-> (file.System Async) (Set file.Path) (Action (List Any))) (let [/ (\ fs separator) ! ///action.monad] (|> sources set.to_list (monad.map ! (function (_ head) (do ! - [_ (: (Promise (Try Any)) - (file.make_directories promise.monad fs head))] - (: (Promise (Try Any)) - (file.make_file promise.monad fs (binary.create 0) (format head / head ".lux"))))))))) + [_ (: (Async (Try Any)) + (file.make_directories async.monad fs head))] + (: (Async (Try Any)) + (file.make_file async.monad fs (binary.create 0) (format head / head ".lux"))))))))) (def: (execute! program fs sample) - (-> (Program Promise) (file.System Promise) ///.Profile (Promise (Try Text))) + (-> (Program Async) (file.System Async) ///.Profile (Async (Try Text))) (do ///action.monad [#let [console ($version.echo "")] _ (..make_sources! fs (get@ #///.sources sample)) @@ -71,7 +71,7 @@ working_directory (random.ascii/alpha 5) #let [/ (\ file.default separator)]] ($_ _.and - (wrap (do {! promise.monad} + (wrap (do {! async.monad} [#let [fs (file.mock /) program (program.async (program.mock environment.empty home working_directory)) @@ -84,17 +84,17 @@ library_exists! (|> library_path (format home /) (\ fs file?) - (\ promise.monad map exception.return)) + (\ async.monad map exception.return)) pom_exists! (|> pom_path (format home /) (\ fs file?) - (\ promise.monad map exception.return))] + (\ async.monad map exception.return))] (wrap (and succeeded! library_exists! pom_exists!)))] (_.cover' [/.do! /.success] (try.default false verdict)))) - (wrap (do {! promise.monad} + (wrap (do {! async.monad} [#let [fs (file.mock /) program (program.async (program.mock environment.empty home working_directory))] logging (..execute! program fs (set@ #///.identity #.None sample))] diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux index 624be95bd..4ee1c49f4 100644 --- a/stdlib/source/test/aedifex/command/pom.lux +++ b/stdlib/source/test/aedifex/command/pom.lux @@ -7,7 +7,7 @@ [control ["." try ("#\." functor)] [concurrency - ["." promise]]] + ["." async]]] [data ["." binary ("#\." equivalence)] ["." text ("#\." equivalence) @@ -36,7 +36,7 @@ (do random.monad [sample @profile.random #let [fs (file.mock (\ file.default separator))]] - (wrap (do {! promise.monad} + (wrap (do {! async.monad} [#let [console (@version.echo "")] outcome (/.do! console fs sample)] (case outcome diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux index 4621028ae..5882992a9 100644 --- a/stdlib/source/test/aedifex/command/test.lux +++ b/stdlib/source/test/aedifex/command/test.lux @@ -8,7 +8,7 @@ ["." try] ["." exception] [concurrency - ["." promise]] + ["." async]] [parser ["." environment]]] [data @@ -61,7 +61,7 @@ ($_ _.and (let [fs (file.mock (\ file.default separator)) console (@version.echo "")] - (wrap (do promise.monad + (wrap (do async.monad [verdict (do ///action.monad [_ (/.do! console (program.async (program.mock environment.empty home working_directory)) fs (shell.async (@build.good_shell [])) resolution @@ -79,7 +79,7 @@ (try.default false verdict))))) (let [fs (file.mock (\ file.default separator)) console (@version.echo "")] - (wrap (do promise.monad + (wrap (do async.monad [verdict (do ///action.monad [#let [bad_shell (shell.mock (function (_ [actual_environment actual_working_directory actual_command actual_arguments]) diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux index d0d172a7a..739a02fef 100644 --- a/stdlib/source/test/aedifex/command/version.lux +++ b/stdlib/source/test/aedifex/command/version.lux @@ -8,7 +8,7 @@ ["." try] ["." exception (#+ exception:)] [concurrency - ["." promise (#+ Promise)]]] + ["." async (#+ Async)]]] [data ["." maybe] ["." text ("#\." equivalence) @@ -58,7 +58,7 @@ (exception.throw ..console_is_closed! [])))) (def: #export echo - (-> Text (Console Promise)) + (-> Text (Console Async)) (|>> [true] (console.mock ..mock) console.async)) @@ -68,9 +68,9 @@ (<| (_.covering /._) (do random.monad [profile @profile.random] - (wrap (do promise.monad + (wrap (do async.monad [#let [console (..echo "")] - verdict (do (try.with promise.monad) + verdict (do (try.with async.monad) [_ (/.do! console profile) logging (\ console read_line [])] (wrap (text\= (version.format language/lux.version) -- cgit v1.2.3