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.lux | 12 ++++----- stdlib/source/program/aedifex/artifact.lux | 2 +- stdlib/source/program/aedifex/cli.lux | 2 +- 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 +++--- stdlib/source/program/aedifex/dependency.lux | 2 +- .../program/aedifex/dependency/deployment.lux | 12 ++++----- .../program/aedifex/dependency/resolution.lux | 28 ++++++++++---------- stdlib/source/program/aedifex/hash.lux | 8 +++--- stdlib/source/program/aedifex/input.lux | 6 ++--- .../source/program/aedifex/metadata/artifact.lux | 12 ++++----- .../source/program/aedifex/metadata/snapshot.lux | 14 +++++----- stdlib/source/program/aedifex/package.lux | 2 +- stdlib/source/program/aedifex/parser.lux | 22 ++++++++-------- stdlib/source/program/aedifex/pom.lux | 6 ++--- stdlib/source/program/aedifex/project.lux | 4 +-- stdlib/source/program/aedifex/repository.lux | 12 ++++----- .../source/program/aedifex/repository/identity.lux | 2 +- stdlib/source/program/aedifex/repository/local.lux | 12 ++++----- .../source/program/aedifex/repository/remote.lux | 6 ++--- stdlib/source/program/compositor.lux | 14 +++++----- 28 files changed, 147 insertions(+), 147 deletions(-) (limited to 'stdlib/source/program') diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux index 182ebf233..810893e99 100644 --- a/stdlib/source/program/aedifex.lux +++ b/stdlib/source/program/aedifex.lux @@ -90,7 +90,7 @@ _ (do async.monad - [_ (at environment exit exit_code)] + [_ (of environment exit exit_code)] (in {try.#Failure ""})))] (in output))) @@ -104,13 +104,13 @@ (def succeed! (IO Any) - (at environment.default exit shell.normal)) + (of environment.default exit shell.normal)) (def (fail! error) (-> Text (IO Any)) (exec (debug.log! error) - (at environment.default exit shell.error))) + (of environment.default exit shell.error))) (def (command action) (All (_ a) (-> (Async (Try a)) (IO Any))) @@ -124,7 +124,7 @@ {try.#Failure error} (..fail! error)))) - (at io.monad in []))) + (of io.monad in []))) (exception.def .public invalid_operation) @@ -151,12 +151,12 @@ (def _ (program.program [[profiles operation] /cli.command] (do [! io.monad] - [console (at ! each (|>> (try.else ..write_only) console.async) + [console (of ! each (|>> (try.else ..write_only) console.async) console.default)] (when operation {/cli.#Version} (..command - (/command/version.do! console (at /.monoid identity))) + (/command/version.do! console (of /.monoid identity))) _ (do ! diff --git a/stdlib/source/program/aedifex/artifact.lux b/stdlib/source/program/aedifex/artifact.lux index 92c8629bc..3b83909e0 100644 --- a/stdlib/source/program/aedifex/artifact.lux +++ b/stdlib/source/program/aedifex/artifact.lux @@ -41,7 +41,7 @@ (def .public equivalence (Equivalence Artifact) - (at ..hash equivalence)) + (of ..hash equivalence)) (def .public order (Order Artifact) diff --git a/stdlib/source/program/aedifex/cli.lux b/stdlib/source/program/aedifex/cli.lux index 8e74893a2..338c02aa0 100644 --- a/stdlib/source/program/aedifex/cli.lux +++ b/stdlib/source/program/aedifex/cli.lux @@ -99,6 +99,6 @@ [head cli.any [tail command] command] (in [{.#Item head tail} command]))) - (at <>.monad each (|>> [(list)]) + (of <>.monad each (|>> [(list)]) ..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 diff --git a/stdlib/source/program/aedifex/dependency.lux b/stdlib/source/program/aedifex/dependency.lux index a83073467..7d9c4d2c9 100644 --- a/stdlib/source/program/aedifex/dependency.lux +++ b/stdlib/source/program/aedifex/dependency.lux @@ -27,7 +27,7 @@ (def .public equivalence (Equivalence Dependency) - (at hash equivalence)) + (of hash equivalence)) (def .public order (Order Dependency) diff --git a/stdlib/source/program/aedifex/dependency/deployment.lux b/stdlib/source/program/aedifex/dependency/deployment.lux index 998298ae3..e98625e8d 100644 --- a/stdlib/source/program/aedifex/dependency/deployment.lux +++ b/stdlib/source/program/aedifex/dependency/deployment.lux @@ -48,11 +48,11 @@ deploy_hash (is (All (_ h) (-> (Codec Text (Hash h)) Extension (Hash h) (Async (Try Any)))) (function (_ codec extension hash) (|> hash - (at codec encoded) - (at utf8.codec encoded) - (at repository upload (format artifact extension)))))] + (of codec encoded) + (of utf8.codec encoded) + (of repository upload (format artifact extension)))))] (do [! (try.with async.monad)] - [_ (at repository upload artifact data)] + [_ (of repository upload artifact data)] (when status {///dependency/status.#Unverified} (in []) @@ -132,7 +132,7 @@ status])) snapshot (///metadata/snapshot.read repository artifact) - snapshot (at ! in (..update_snapshot [artifact type] now snapshot)) + snapshot (of ! in (..update_snapshot [artifact type] now snapshot)) _ (///metadata/snapshot.write repository artifact snapshot) project (///metadata/artifact.read repository artifact) _ (|> project @@ -147,4 +147,4 @@ (|> (dictionary.entries resolution) (monad.each ! (function (_ [dependency package]) (..one repository dependency package))) - (at ! each (set.of_list ///artifact.hash))))) + (of ! each (set.of_list ///artifact.hash))))) diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux index 84879b93d..62a85a974 100644 --- a/stdlib/source/program/aedifex/dependency/resolution.lux +++ b/stdlib/source/program/aedifex/dependency/resolution.lux @@ -82,19 +82,19 @@ (Exception [Artifact Extension Text]) (Async (Try (Maybe (Hash h)))))) (do async.monad - [?actual (at repository download (///repository/remote.uri version_template artifact extension))] + [?actual (of repository download (///repository/remote.uri version_template artifact extension))] (when ?actual {try.#Success actual} (in (do [! try.monad] - [output (at ! each (|>> ffi.as_string java/lang/String::trim ffi.of_string) - (at utf8.codec decoded actual)) + [output (of ! each (|>> ffi.as_string java/lang/String::trim ffi.of_string) + (of utf8.codec decoded actual)) actual (|> output (text.all_split_by " ") list.head (maybe.else output) - (at codec decoded)) + (of codec decoded)) _ (exception.assertion exception [artifact extension output] - (at ///hash.equivalence = (hash library) actual))] + (of ///hash.equivalence = (hash library) actual))] (in {.#Some actual}))) {try.#Failure error} @@ -103,7 +103,7 @@ (def (hashed repository version_template artifact extension) (-> (Repository Async) Version Artifact Extension (Async (Try [Binary Status]))) (do (try.with async.monad) - [data (at repository download (///repository/remote.uri version_template artifact extension)) + [data (of repository download (///repository/remote.uri version_template artifact extension)) ?sha1 (..verified_hash data repository version_template artifact (format extension ///artifact/extension.sha1) ///hash.sha1 ///hash.sha1_codec ..sha1_does_not_match) @@ -135,10 +135,10 @@ artifact (has ///artifact.#version artifact_version artifact)] [pom_data pom_status] (..hashed repository version_template artifact ///artifact/extension.pom) library_&_status (..hashed repository version_template artifact extension)] - (at async.monad in + (of async.monad in (do try.monad - [pom (at utf8.codec decoded pom_data) - pom (at xml.codec decoded pom) + [pom (of utf8.codec decoded pom_data) + pom (of xml.codec decoded pom) profile (.result ///pom.parser (list pom))] (in [///package.#origin {///repository/origin.#Remote ""} ///package.#library library_&_status @@ -164,11 +164,11 @@ (with_template [ ] [(def ( console repository artifact) (-> (Console Async) (Repository Async) Artifact (Async (Try Any))) - (at console write (format "[" "]" + (of console write (format "[" "]" " " " " (///artifact.format artifact) " " - " " (%.text (at repository description)) + " " (%.text (of repository description)) text.new_line)))] ["?" announce_fetching "Fetching" "from"] @@ -182,7 +182,7 @@ {.#End} (|> dependency (exception.except ..cannot_resolve) - (at async.monad in)) + (of async.monad in)) {.#Item repository alternatives} (do [! async.monad] @@ -211,7 +211,7 @@ resolution resolution]) (when dependencies {.#End} - (at async.monad in + (of async.monad in [successes failures resolution]) {.#Item head tail} @@ -234,7 +234,7 @@ {try.#Success package} (do ! [.let [redundant? (is (Predicate Dependency) - (predicate.or (at //.equivalence = head) + (predicate.or (of //.equivalence = head) (dictionary.key? resolution))) sub_dependencies (|> package ///package.dependencies diff --git a/stdlib/source/program/aedifex/hash.lux b/stdlib/source/program/aedifex/hash.lux index 8b0922916..4176dd694 100644 --- a/stdlib/source/program/aedifex/hash.lux +++ b/stdlib/source/program/aedifex/hash.lux @@ -59,7 +59,7 @@ (def encoded (Format Binary) (binary.mix (function (_ byte representation) - (let [hex (at n.hex encoded byte) + (let [hex (of n.hex encoded byte) hex (when (text.size hex) 1 (format "0" hex) _ hex)] @@ -132,7 +132,7 @@ (when (text.split_at ..hex_per_chunk input) {.#Some [head tail]} (do try.monad - [head (at n.hex decoded head) + [head (of n.hex decoded head) output (binary.has_64! index head output)] (again tail (++ chunk) output)) @@ -142,7 +142,7 @@ (^.with_template [ ] [ (do try.monad - [head (at n.hex decoded input) + [head (of n.hex decoded input) output ( index head output)] (constructor output))]) ([1 binary.has_8!] @@ -166,7 +166,7 @@ (All (_ h) (Equivalence (Hash h))) (implementation (def (= reference subject) - (at binary.equivalence = + (of binary.equivalence = (representation reference) (representation subject))))) ) diff --git a/stdlib/source/program/aedifex/input.lux b/stdlib/source/program/aedifex/input.lux index cf65de5b6..2fd3b4e60 100644 --- a/stdlib/source/program/aedifex/input.lux +++ b/stdlib/source/program/aedifex/input.lux @@ -44,15 +44,15 @@ (def project_parser (-> Binary (Try Project)) (|>> (pipe.do try.monad - [(at utf8.codec decoded)] + [(of utf8.codec decoded)] [..lux_parser] [(list) (.result //parser.project)]))) (def .public (read monad fs profiles) (All (_ !) (-> (Monad !) (file.System !) (List Name) (! (Try Profile)))) (|> //project.file - (at fs read) - (at monad each + (of fs read) + (of monad each (function (_ it) (do [! try.monad] [it it diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux index 3fa300bf8..9ae6f0ef4 100644 --- a/stdlib/source/program/aedifex/metadata/artifact.lux +++ b/stdlib/source/program/aedifex/metadata/artifact.lux @@ -178,13 +178,13 @@ (def .public (read repository artifact) (-> (Repository Async) Artifact (Async (Try Metadata))) (do async.monad - [project (at repository download (..uri artifact))] + [project (of repository download (..uri artifact))] (when project {try.#Success binary_metadata} (in (|> binary_metadata (pipe.do try.monad - [(at utf8.codec decoded)] - [(at xml.codec decoded)] + [(of utf8.codec decoded)] + [(of xml.codec decoded)] [list (.result ..parser)]))) {try.#Failure error} @@ -199,6 +199,6 @@ (-> (Repository Async) Artifact Metadata (Async (Try Any))) (|> metadata ..format - (at xml.codec encoded) - (at utf8.codec encoded) - (at repository upload (..uri artifact)))) + (of xml.codec encoded) + (of utf8.codec encoded) + (of repository upload (..uri artifact)))) diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux index 63000bac4..2c372392d 100644 --- a/stdlib/source/program/aedifex/metadata/snapshot.lux +++ b/stdlib/source/program/aedifex/metadata/snapshot.lux @@ -94,7 +94,7 @@ ///artifact/snapshot/version.#value version ///artifact/snapshot/version.#updated ///artifact/time.epoch]] (|> (.somewhere ///artifact/versioning.parser) - (at ! each + (of ! each (revised ///artifact/versioning.#versions (is (-> (List ///artifact/snapshot/version.Version) (List ///artifact/snapshot/version.Version)) @@ -126,13 +126,13 @@ (def .public (read repository artifact) (-> (Repository Async) Artifact (Async (Try Metadata))) (do async.monad - [project (at repository download (..uri artifact))] + [project (of repository download (..uri artifact))] (when project {try.#Success project} (in (|> project (pipe.do try.monad - [(at utf8.codec decoded)] - [(at xml.codec decoded)] + [(of utf8.codec decoded)] + [(of xml.codec decoded)] [list (.result ..parser)]))) {try.#Failure error} @@ -144,6 +144,6 @@ (-> (Repository Async) Artifact Metadata (Async (Try Any))) (|> metadata ..format - (at xml.codec encoded) - (at utf8.codec encoded) - (at repository upload (..uri artifact)))) + (of xml.codec encoded) + (of utf8.codec encoded) + (of repository upload (..uri artifact)))) diff --git a/stdlib/source/program/aedifex/package.lux b/stdlib/source/program/aedifex/package.lux index ace318f61..3b3e4b71f 100644 --- a/stdlib/source/program/aedifex/package.lux +++ b/stdlib/source/program/aedifex/package.lux @@ -53,7 +53,7 @@ #library [library {//status.#Verified (//hash.sha1 library) (//hash.md5 library)}] - #pom (let [binary_pom (|> pom (at xml.codec encoded) (at utf8.codec encoded))] + #pom (let [binary_pom (|> pom (of xml.codec encoded) (of utf8.codec encoded))] [pom binary_pom {//status.#Verified (//hash.sha1 binary_pom) diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux index 96a717dbc..6e670a5c7 100644 --- a/stdlib/source/program/aedifex/parser.lux +++ b/stdlib/source/program/aedifex/parser.lux @@ -78,7 +78,7 @@ (def license (Parser /.License) (do [! <>.monad] - [input (at ! each + [input (of ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text .any))))] @@ -93,7 +93,7 @@ (def organization (Parser /.Organization) (do [! <>.monad] - [input (at ! each + [input (of ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text .any))))] @@ -104,7 +104,7 @@ (def developer (Parser /.Developer) (do [! <>.monad] - [input (at ! each + [input (of ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text .any))))] @@ -121,7 +121,7 @@ (def info (Parser /.Info) (do [! <>.monad] - [input (at ! each + [input (of ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text .any))))] @@ -198,7 +198,7 @@ (def profile (Parser /.Profile) (do [! <>.monad] - [input (at ! each + [input (of ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text .any)))) @@ -213,12 +213,12 @@ (..singular input "info" ..info))) ^repositories (is (Parser (Set //repository.Address)) (|> (..plural input "repositories" ..repository) - (at ! each (set.of_list text.hash)) + (of ! each (set.of_list text.hash)) (<>.else (set.empty text.hash)) - (at ! each (set.has /.default_repository)))) + (of ! each (set.has /.default_repository)))) ^dependencies (is (Parser (Set //dependency.Dependency)) (|> (..plural input "dependencies" ..dependency) - (at ! each (set.of_list //dependency.hash)) + (of ! each (set.of_list //dependency.hash)) (<>.else (set.empty //dependency.hash)))) ^lux (|> ..dependency (..singular input //format.lux_compiler_label) @@ -228,7 +228,7 @@ (<>.else (list))) ^sources (is (Parser (Set /.Source)) (|> (..plural input "sources" ..source) - (at ! each (set.of_list text.hash)) + (of ! each (set.of_list text.hash)) (<>.else (set.of_list text.hash (list /.default_source))))) ^target (is (Parser /.Target) (|> ..target @@ -241,7 +241,7 @@ (<>.maybe (..singular input "test" ..program))) ^deploy_repositories (is (Parser (Dictionary Text //repository.Address)) - (<| (at ! each (dictionary.of_list text.hash)) + (<| (of ! each (dictionary.of_list text.hash)) (<>.else (list)) (..plural input "deploy_repositories" ..deploy_repository))) ^configuration (is (Parser (property.List Text)) @@ -285,7 +285,7 @@ (def .public project (Parser Project) - (at <>.monad each + (of <>.monad each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text ..profile))))) diff --git a/stdlib/source/program/aedifex/pom.lux b/stdlib/source/program/aedifex/pom.lux index 93c6b9f47..afcfc29f6 100644 --- a/stdlib/source/program/aedifex/pom.lux +++ b/stdlib/source/program/aedifex/pom.lux @@ -175,13 +175,13 @@ (do [! <>.monad] [tag .tag] (<| (.node tag) - (at ! each (|>> [tag])) + (of ! each (|>> [tag])) .text))) (def (dependency_parser own_version parent_version) (-> Text Text (Parser Dependency)) (do [! <>.monad] - [properties (at ! each (dictionary.of_list symbol.hash) + [properties (of ! each (dictionary.of_list symbol.hash) (<| (.node ["" ..dependency_tag]) (<>.some ..property_parser)))] (<| <>.of_try @@ -240,7 +240,7 @@ .somewhere (<>.else (list))) _ (<>.some .any)] - (in (|> (at /.monoid identity) + (in (|> (of /.monoid identity) (revised /.#dependencies (function (_ empty) (list#mix set.has empty dependencies))) (revised /.#repositories (function (_ empty) diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux index d35873c71..5cf279d4b 100644 --- a/stdlib/source/program/aedifex/project.lux +++ b/stdlib/source/program/aedifex/project.lux @@ -39,7 +39,7 @@ (dictionary.empty text.hash)) (def composite - (dictionary.composite_with (at //.monoid composite))))) + (dictionary.composite_with (of //.monoid composite))))) (exception.def .public (unknown_profile name) (Exception Name) @@ -66,7 +66,7 @@ [parents (monad.each ! (profile' (set.has name lineage) project) (the //.#parents profile))] (in (list#mix (function (_ parent child) - (at //.monoid composite child parent)) + (of //.monoid composite child parent)) (has //.#parents (list) profile) parents)))) diff --git a/stdlib/source/program/aedifex/repository.lux b/stdlib/source/program/aedifex/repository.lux index ea0507bcf..42053974e 100644 --- a/stdlib/source/program/aedifex/repository.lux +++ b/stdlib/source/program/aedifex/repository.lux @@ -28,12 +28,12 @@ (-> (Repository IO) (Repository Async)) (implementation (def description - (at repository description)) + (of repository description)) (def (download uri) - (async.future (at repository download uri))) + (async.future (of repository download uri))) (def (upload uri content) - (async.future (at repository upload uri content))) + (async.future (of repository upload uri content))) )) (type .public (Mock s) @@ -50,13 +50,13 @@ (let [state (stm.var init)] (implementation (def description - (at mock the_description)) + (of mock the_description)) (def (download uri) (stm.commit! (do [! stm.monad] [|state| (stm.read state)] - (when (at mock on_download uri |state|) + (when (of mock on_download uri |state|) {try.#Success [|state| output]} (do ! [_ (stm.write |state| state)] @@ -69,7 +69,7 @@ (stm.commit! (do [! stm.monad] [|state| (stm.read state)] - (when (at mock on_upload uri content |state|) + (when (of mock on_upload uri content |state|) {try.#Success |state|} (do ! [_ (stm.write |state| state)] diff --git a/stdlib/source/program/aedifex/repository/identity.lux b/stdlib/source/program/aedifex/repository/identity.lux index eaca93cdb..30814ecee 100644 --- a/stdlib/source/program/aedifex/repository/identity.lux +++ b/stdlib/source/program/aedifex/repository/identity.lux @@ -39,7 +39,7 @@ (def .public (basic_auth user password) (-> User Password Text) - (let [credentials (at utf8.codec encoded (format user ":" password))] + (let [credentials (of utf8.codec encoded (format user ":" password))] (|> (java/util/Base64::getEncoder) (java/util/Base64$Encoder::encodeToString credentials) ffi.of_string diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux index dcc604306..4223ddf39 100644 --- a/stdlib/source/program/aedifex/repository/local.lux +++ b/stdlib/source/program/aedifex/repository/local.lux @@ -22,10 +22,10 @@ (def .public (root environment fs) (-> (Environment Async) (file.System Async) file.Path) - (let [/ (at fs separator)] + (let [/ (of fs separator)] (|> ///local.repository (text.replaced uri.separator /) - (format (at environment home) /)))) + (format (of environment home) /)))) (def (path /) (-> Text (-> URI file.Path)) @@ -33,7 +33,7 @@ (def (absolute_path environment fs) (-> (Environment Async) (file.System Async) (-> URI file.Path)) - (let [/ (at fs separator)] + (let [/ (of fs separator)] (|>> ///metadata.local_uri (..path /) (format (..root environment fs) /)))) @@ -46,12 +46,12 @@ (def download (|>> (..absolute_path environment fs) - (at fs read))) + (of fs read))) (def (upload uri content) (do [! async.monad] [.let [absolute_path (..absolute_path environment fs uri)] - ? (at fs file? absolute_path) + ? (of fs file? absolute_path) _ (is (Async (Try Any)) (if ? (in {try.#Success []}) @@ -61,4 +61,4 @@ _ (in {try.#Success []}))))] - (at fs write absolute_path content))))) + (of fs write absolute_path content))))) diff --git a/stdlib/source/program/aedifex/repository/remote.lux b/stdlib/source/program/aedifex/repository/remote.lux index 34488b544..9386c214f 100644 --- a/stdlib/source/program/aedifex/repository/remote.lux +++ b/stdlib/source/program/aedifex/repository/remote.lux @@ -69,12 +69,12 @@ http))] (when status http/status.ok - (at ! each product.right ((the @http.#body message) {.#None})) + (of ! each product.right ((the @http.#body message) {.#None})) _ (do ! [_ ((the @http.#body message) {.#Some 0})] - (at io.monad in (exception.except ..download_failure [(format address uri) status])))))) + (of io.monad in (exception.except ..download_failure [(format address uri) status])))))) (def (upload uri content) (do (try.with io.monad) @@ -95,5 +95,5 @@ (in []) _ - (at io.monad in (exception.except ..upload_failure [(format address uri) status]))))) + (of io.monad in (exception.except ..upload_failure [(format address uri) status]))))) )) diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux index 873c4c08d..93126b8d8 100644 --- a/stdlib/source/program/compositor.lux +++ b/stdlib/source/program/compositor.lux @@ -80,7 +80,7 @@ (console.write_line report console))) (is (Async (Try Any)) )))] - (io.run! (at world/environment.default exit +1)))) + (io.run! (of world/environment.default exit +1)))) {try.#Success output} (in output)))) @@ -103,18 +103,18 @@ {try.#Success content} (when content {.#Left content} - (at fs write package content) + (of fs write package content) {.#Right content} (do [! (try.with async.monad)] - [_ (at fs make_directory package) + [_ (of fs make_directory package) _ (monad.each ! (function (_ [name content]) - (at fs write (file.rooted fs package name) content)) + (of fs write (file.rooted fs package name) content)) content)] (in []))) {try.#Failure error} - (at async.monad in {try.#Failure error}))) + (of async.monad in {try.#Failure error}))) (def (load_host_dependencies fs host_dependencies) (-> (file.System Async) (List file.Path) (Async (Try (Dictionary file.Path Binary)))) @@ -129,7 +129,7 @@ {.#Item head tail} (do ! - [content (at fs read head)] + [content (of fs read head)] (again tail (dictionary.has head content output))))))) @@ -224,6 +224,6 @@ ... (do [! async.monad] ... [console (|> console.default ... async.future - ... (at ! each (|>> try.trusted console.async)))] + ... (of ! each (|>> try.trusted console.async)))] ... (interpreter.run! (try.with async.monad) console platform interpretation translation_bundle))) )))) -- cgit v1.2.3