From 94e5802f594a73245fce0fbd885103b8bf210d57 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 2 Dec 2022 19:33:00 -0400 Subject: Added some simple time-series handling machinery. --- stdlib/source/program/aedifex/command/auto.lux | 14 +++++----- stdlib/source/program/aedifex/command/build.lux | 18 ++++++------- stdlib/source/program/aedifex/command/clean.lux | 18 ++++++------- .../program/aedifex/command/deploy/release.lux | 30 +++++++++++----------- .../program/aedifex/command/deploy/snapshot.lux | 8 +++--- stdlib/source/program/aedifex/command/deps.lux | 8 +++--- stdlib/source/program/aedifex/command/install.lux | 6 ++--- stdlib/source/program/aedifex/command/pom.lux | 6 ++--- stdlib/source/program/aedifex/command/test.lux | 8 +++--- 9 files changed, 58 insertions(+), 58 deletions(-) (limited to 'stdlib/source/program/aedifex/command') diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux index a5f02d37f..61ff6c78f 100644 --- a/stdlib/source/program/aedifex/command/auto.lux +++ b/stdlib/source/program/aedifex/command/auto.lux @@ -29,11 +29,11 @@ (-> (file.System Async) file.Path (Async (List file.Path))) (let [! async.monad] (|> path - (at fs sub_directories) - (at ! each (|>> (try.else (list)) + (of fs sub_directories) + (of ! each (|>> (try.else (list)) (monad.each ! (targets fs)))) - (at ! conjoint) - (at ! each (|>> list.together (list.partial path)))))) + (of ! conjoint) + (of ! each (|>> list.together (list.partial path)))))) (def .public delay Nat @@ -56,14 +56,14 @@ (the ///.#sources) set.list (monad.each ! (..targets fs)) - (at ! each list.together))] + (of ! each list.together))] (do [! ///action.monad] - [_ (monad.each ! (at watcher start watch.modification) targets) + [_ (monad.each ! (of watcher start watch.modification) targets) _ ] (loop (again [_ []]) (do ! [_ (..pause delay) - events (at watcher poll [])] + events (of watcher poll [])] (when events {.#Item _} (do ! diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index 107ae46a4..71c87d8ce 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -121,7 +121,7 @@ (def (path fs home dependency) (All (_ !) (-> (file.System !) Path Dependency Path)) - (let [/ (at fs separator) + (let [/ (of fs separator) artifact (the ///dependency.#artifact dependency)] (|> artifact (///local.uri (the ///artifact.#version artifact)) @@ -177,7 +177,7 @@ version (the ///artifact.#version artifact)] (when (dictionary.value identity uniques) {.#Some [current_version current_path]} - (if (at version_order < version current_version) + (if (of version_order < version current_version) (dictionary.has identity [version dependency] uniques) uniques) @@ -211,7 +211,7 @@ (let [[read! write!] (is [(Async (Try Any)) (async.Resolver (Try Any))] (async.async [])) - _ (|> (at process []) + _ (|> (of process []) (async.upon! (function (again ?line) (when ?line {try.#Failure error} @@ -228,7 +228,7 @@ {try.#Success _} (async.upon! again - (at process [])))) + (of process [])))) (is (Async (Try Any)) (console.write_line line console)))))) io.run!)] @@ -285,8 +285,8 @@ {.#Some [program_module program_definition]} (do async.monad - [.let [home (at environment home) - working_directory (at environment directory)] + [.let [home (of environment home) + working_directory (of environment directory)] environment (environment.environment async.monad environment)] (do ///action.monad [[resolution lux] (async#in (..lux resolution (the ///.#lux profile))) @@ -309,7 +309,7 @@ [#Python ///.#java "program.py"] [#Lua ///.#java "program.lua"] [#Ruby ///.#java (file.rooted fs "program" ruby_packager.main_file)])) - / (at fs separator) + / (of fs separator) cache_directory (format working_directory / target)] _ (is (Async (Try Any)) (console.write_line ..start console)) @@ -325,13 +325,13 @@ _ (list#composite (..singular "--module" program_module) (..singular "--program" program_definition))) (..singular "--configuration" (configuration.format (the ///.#configuration profile)))))] - process (at shell execute [(dictionary.composite environment command_environment) + process (of shell execute [(dictionary.composite environment command_environment) working_directory command full_parameters]) _ (..log_output! console process) _ (..log_error! console process) - exit (at process await []) + exit (of process await []) _ (is (Async (Try Any)) (console.write_line (if (i.= shell.normal exit) ..success diff --git a/stdlib/source/program/aedifex/command/clean.lux b/stdlib/source/program/aedifex/command/clean.lux index 40609f4d4..83daefbd0 100644 --- a/stdlib/source/program/aedifex/command/clean.lux +++ b/stdlib/source/program/aedifex/command/clean.lux @@ -22,9 +22,9 @@ (-> (file.System Async) Path (Async (Try Any))) (do [! ///action.monad] [_ (|> root - (at fs directory_files) - (at ! each (monad.each ! (at fs delete))) - (at ! conjoint))] + (of fs directory_files) + (of ! each (monad.each ! (of fs delete))) + (of ! conjoint))] (in []))) (def .public success @@ -35,16 +35,16 @@ (-> (Console Async) (file.System Async) (Command Any)) (do [! async.monad] [.let [target (the ///.#target profile)] - ? (at fs directory? target) + ? (of fs directory? target) _ (let [! ///action.monad] (if ? (loop (again [root target]) (do ! [_ (..clean_files! fs root) _ (|> root - (at fs sub_directories) - (at ! each (monad.each ! again)) - (at ! conjoint))] - (at fs delete root))) - (at ! in [])))] + (of fs sub_directories) + (of ! each (monad.each ! again)) + (of ! conjoint))] + (of fs delete root))) + (of ! in [])))] (console.write_line (..success target) console))) diff --git a/stdlib/source/program/aedifex/command/deploy/release.lux b/stdlib/source/program/aedifex/command/deploy/release.lux index eb0e4d3ec..c159555b9 100644 --- a/stdlib/source/program/aedifex/command/deploy/release.lux +++ b/stdlib/source/program/aedifex/command/deploy/release.lux @@ -70,7 +70,7 @@ (def windows? (IO (Try Bit)) - (at (try.with io.monad) each + (of (try.with io.monad) each (|>> java/lang/String::toLowerCase ffi.of_string (text.starts_with? "windows")) (java/lang/System::getProperty (ffi.as_string "os.name")))) @@ -118,9 +118,9 @@ (-> (Environment Async) (Repository Async) (file.System Async) Artifact (Async (Try Any))) (do (try.with async.monad) [.let [$artifact (////artifact.uri (the ////artifact.#version artifact) artifact)] - _ (at local upload (..jar $artifact) ..dummy_jar) - _ (at local upload (..javadoc $artifact) ..dummy_jar) - _ (at local upload (..sources $artifact) ..dummy_jar)] + _ (of local upload (..jar $artifact) ..dummy_jar) + _ (of local upload (..javadoc $artifact) ..dummy_jar) + _ (of local upload (..sources $artifact) ..dummy_jar)] (in []))) (def (signed it) @@ -130,8 +130,8 @@ (def (release_unsigned_artifact! local remote uri) (-> (Repository Async) (Repository Async) Text (Async (Try Binary))) (do [! ////action.monad] - [it (at local download uri) - _ (at remote upload uri it)] + [it (of local download uri) + _ (of remote upload uri it)] (in it))) (def (release_signed_artifact! local remote [artifact signature]) @@ -140,14 +140,14 @@ [it (..release_unsigned_artifact! local remote artifact) _ (|> it ////hash.md5 - (at ////hash.md5_codec encoded) - (at utf8.codec encoded) - (at remote upload (..md5 artifact))) + (of ////hash.md5_codec encoded) + (of utf8.codec encoded) + (of remote upload (..md5 artifact))) _ (|> it ////hash.sha1 - (at ////hash.sha1_codec encoded) - (at utf8.codec encoded) - (at remote upload (..sha1 artifact))) + (of ////hash.sha1_codec encoded) + (of utf8.codec encoded) + (of remote upload (..sha1 artifact))) _ (..release_unsigned_artifact! local remote signature)] (in []))) @@ -158,16 +158,16 @@ _ (install_dummies! environment local fs artifact) .let [@root (////repository/local.root environment fs) $bundle (////artifact.bundle (the ////artifact.#version artifact) artifact) - / (at fs separator) + / (of fs separator) @local (%.format @root / $bundle)] windows? (async.future ..windows?) process (is (Async (Try (shell.Process Async))) - (at shell execute [environment.empty @local + (of shell execute [environment.empty @local (if windows? ["cmd" (list "/c" "for %file in (.\*) do gpg.exe -ab %file")] ["sh" (list "-c" "for file in *.*; do gpg -ab $file; done")])])) exit (is (Async (Try shell.Exit)) - (at process await [])) + (of process await [])) .let [$artifact (////artifact.uri (the ////artifact.#version artifact) artifact)] _ (monad.each ! (release_signed_artifact! local remote) (list (..signed (..pom $artifact)) diff --git a/stdlib/source/program/aedifex/command/deploy/snapshot.lux b/stdlib/source/program/aedifex/command/deploy/snapshot.lux index bd253bfcd..932d4885c 100644 --- a/stdlib/source/program/aedifex/command/deploy/snapshot.lux +++ b/stdlib/source/program/aedifex/command/deploy/snapshot.lux @@ -52,14 +52,14 @@ (the /.#sources) set.list (export.library fs) - (at ! each (binary.result tar.format))) - pom (at async.monad in (////pom.write profile)) + (of ! each (binary.result tar.format))) + pom (of async.monad in (////pom.write profile)) _ (////dependency/deployment.one remote [artifact ////artifact/type.lux_library] (let [pom_data (|> pom - (at xml.codec encoded) - (at utf8.codec encoded))] + (of xml.codec encoded) + (of utf8.codec encoded))] [////package.#origin {////repository/origin.#Remote ""} ////package.#library [library (////dependency/status.verified library)] diff --git a/stdlib/source/program/aedifex/command/deps.lux b/stdlib/source/program/aedifex/command/deps.lux index 4ec5693f0..d531b3a7c 100644 --- a/stdlib/source/program/aedifex/command/deps.lux +++ b/stdlib/source/program/aedifex/command/deps.lux @@ -58,19 +58,19 @@ (///dependency/deployment.all local)) _ (console.write_line (exception.report (list ["Local successes" (|> local_successes - (list.sorted (at ///dependency.order <)) + (list.sorted (of ///dependency.order <)) (exception.listing ..format))] ["Local failures" (|> local_failures - (list.sorted (at ///dependency.order <)) + (list.sorted (of ///dependency.order <)) (exception.listing ..format))] ["Remote successes" (|> remote_successes (set.of_list ///dependency.hash) (set.difference (set.of_list ///dependency.hash local_successes)) set.list - (list.sorted (at ///dependency.order <)) + (list.sorted (of ///dependency.order <)) (exception.listing ..format))] ["Remote failures" (|> remote_failures - (list.sorted (at ///dependency.order <)) + (list.sorted (of ///dependency.order <)) (exception.listing ..format))])) console)] (in resolution)))) diff --git a/stdlib/source/program/aedifex/command/install.lux b/stdlib/source/program/aedifex/command/install.lux index b28e2b275..c3e896c49 100644 --- a/stdlib/source/program/aedifex/command/install.lux +++ b/stdlib/source/program/aedifex/command/install.lux @@ -61,12 +61,12 @@ (export.library fs)) pom (|> profile ///pom.write - (at async.monad in)) + (of async.monad in)) _ (///dependency/deployment.one local [identity ///artifact/type.lux_library] (let [pom_data (|> pom - (at xml.codec encoded) - (at utf8.codec encoded))] + (of xml.codec encoded) + (of utf8.codec encoded))] [///package.#origin {///origin.#Local ""} ///package.#library (let [library (binary.result tar.format package)] [library (///dependency/status.verified library)]) diff --git a/stdlib/source/program/aedifex/command/pom.lux b/stdlib/source/program/aedifex/command/pom.lux index 71d8a9223..ea2fbc753 100644 --- a/stdlib/source/program/aedifex/command/pom.lux +++ b/stdlib/source/program/aedifex/command/pom.lux @@ -29,9 +29,9 @@ (-> (Console Async) (file.System Async) (Command Any)) (do ///action.monad [content (|> (///pom.write profile) - (try#each (|>> (at xml.codec encoded) - (at utf8.codec encoded))) + (try#each (|>> (of xml.codec encoded) + (of utf8.codec encoded))) async#in) - _ (at fs write ///pom.file content)] + _ (of fs write ///pom.file content)] (is (Async (Try Any)) (console.write_line ..success console)))) diff --git a/stdlib/source/program/aedifex/command/test.lux b/stdlib/source/program/aedifex/command/test.lux index f22372abf..7c5a8cdd6 100644 --- a/stdlib/source/program/aedifex/command/test.lux +++ b/stdlib/source/program/aedifex/command/test.lux @@ -38,8 +38,8 @@ (def .public (do! console environment fs shell resolution profile) (-> (Console Async) (Environment Async) (file.System Async) (Shell Async) Resolution (Command [Exit Any])) (do async.monad - [.let [home (at environment home) - working_directory (at environment directory)] + [.let [home (of environment home) + working_directory (of environment directory)] environment_vars (environment.environment async.monad environment)] (do [! ///action.monad] [[build_exit compiler program] (//build.do! console environment fs shell resolution @@ -63,13 +63,13 @@ [//build.#Python ///.#python] [//build.#Lua ///.#lua] [//build.#Ruby ///.#ruby]))] - process (at shell execute [(dictionary.composite environment_vars command_environment) + process (of shell execute [(dictionary.composite environment_vars command_environment) working_directory test_command test_parameters]) _ (//build.log_output! console process) _ (//build.log_error! console process) - exit (at process await []) + exit (of process await []) _ (is (Async (Try Any)) (console.write_line (if (i.= shell.normal exit) ..success -- cgit v1.2.3