From 132ffdae1add622c8a3c6065d7730a8fe8ea5e78 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 5 Sep 2021 22:52:26 -0400 Subject: Changed the syntax of do/be's (co)monad bindings. --- stdlib/source/program/aedifex.lux | 2 +- stdlib/source/program/aedifex/command/auto.lux | 4 ++-- stdlib/source/program/aedifex/command/clean.lux | 2 +- stdlib/source/program/aedifex/command/deploy.lux | 2 +- stdlib/source/program/aedifex/command/test.lux | 2 +- stdlib/source/program/aedifex/dependency/deployment.lux | 4 ++-- stdlib/source/program/aedifex/dependency/resolution.lux | 6 +++--- stdlib/source/program/aedifex/input.lux | 2 +- stdlib/source/program/aedifex/metadata/snapshot.lux | 2 +- stdlib/source/program/aedifex/parser.lux | 10 +++++----- stdlib/source/program/aedifex/pom.lux | 6 +++--- stdlib/source/program/aedifex/project.lux | 2 +- stdlib/source/program/aedifex/repository.lux | 4 ++-- stdlib/source/program/aedifex/repository/local.lux | 2 +- stdlib/source/program/aedifex/repository/remote.lux | 2 +- stdlib/source/program/compositor.lux | 6 +++--- stdlib/source/program/compositor/export.lux | 2 +- stdlib/source/program/scriptum.lux | 4 ++-- 18 files changed, 32 insertions(+), 32 deletions(-) (limited to 'stdlib/source/program') diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux index b89317b0d..93a188f95 100644 --- a/stdlib/source/program/aedifex.lux +++ b/stdlib/source/program/aedifex.lux @@ -125,7 +125,7 @@ (\ io.monad in []))) (program: [[profiles operation] /cli.command] - (do {! io.monad} + (do [! io.monad] [?console console.default] (case (try\each console.async ?console) (#try.Failure error) diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux index 4e2fd064c..5e3b425fe 100644 --- a/stdlib/source/program/aedifex/command/auto.lux +++ b/stdlib/source/program/aedifex/command/auto.lux @@ -51,13 +51,13 @@ (function (_ console program fs shell resolution) (function (_ profile) (with_expansions [ ((command console program fs shell resolution) profile)] - (do {! async.monad} + (do [! async.monad] [targets (|> profile (value@ #///.sources) set.list (monad.each ! (..targets fs)) (\ ! each list.together))] - (do {! ///action.monad} + (do [! ///action.monad] [_ (monad.each ! (\ watcher start watch.modification) targets) _ ] (loop [_ []] diff --git a/stdlib/source/program/aedifex/command/clean.lux b/stdlib/source/program/aedifex/command/clean.lux index c5599e15e..0d8a62512 100644 --- a/stdlib/source/program/aedifex/command/clean.lux +++ b/stdlib/source/program/aedifex/command/clean.lux @@ -32,7 +32,7 @@ (def: .public (do! console fs profile) (-> (Console Async) (file.System Async) (Command Any)) - (do {! async.monad} + (do [! async.monad] [.let [target (value@ #///.target profile)] ? (\ fs directory? target) _ (let [! ///action.monad] diff --git a/stdlib/source/program/aedifex/command/deploy.lux b/stdlib/source/program/aedifex/command/deploy.lux index 787496543..49837055c 100644 --- a/stdlib/source/program/aedifex/command/deploy.lux +++ b/stdlib/source/program/aedifex/command/deploy.lux @@ -58,7 +58,7 @@ (def: .public (do! console repository fs artifact profile) (-> (Console Async) (Repository Async) (file.System Async) Artifact (Command Any)) - (do {! ///action.monad} + (do [! ///action.monad] [library (|> profile (value@ #/.sources) set.list diff --git a/stdlib/source/program/aedifex/command/test.lux b/stdlib/source/program/aedifex/command/test.lux index 822cc874b..8c18e45be 100644 --- a/stdlib/source/program/aedifex/command/test.lux +++ b/stdlib/source/program/aedifex/command/test.lux @@ -33,7 +33,7 @@ (do async.monad [environment (program.environment async.monad program) .let [working_directory (\ program directory)]] - (do {! ///action.monad} + (do [! ///action.monad] [.let [home (\ program home)] [build_exit compiler program] (//build.do! console program fs shell resolution (with@ #///.program (value@ #///.test profile) profile))] diff --git a/stdlib/source/program/aedifex/dependency/deployment.lux b/stdlib/source/program/aedifex/dependency/deployment.lux index 5abc9979a..5227a8b95 100644 --- a/stdlib/source/program/aedifex/dependency/deployment.lux +++ b/stdlib/source/program/aedifex/dependency/deployment.lux @@ -50,7 +50,7 @@ (\ codec encoded) (\ utf8.codec encoded) (\ repository upload (format artifact extension)))))] - (do {! (try.with async.monad)} + (do [! (try.with async.monad)] [_ (\ repository upload artifact data)] (case status #///dependency/status.Unverified @@ -117,7 +117,7 @@ (def: .public (one repository [artifact type] package) (-> (Repository Async) Dependency Package (Async (Try Artifact))) - (do {! async.monad} + (do [! async.monad] [now (async.future instant.now) .let [version_template (value@ #///artifact.version artifact)]] (do (try.with !) diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux index 99e8b9adf..b8aead0aa 100644 --- a/stdlib/source/program/aedifex/dependency/resolution.lux +++ b/stdlib/source/program/aedifex/dependency/resolution.lux @@ -84,7 +84,7 @@ [?actual (\ repository download (///repository/remote.uri version_template artifact extension))] (case ?actual (#try.Success actual) - (in (do {! try.monad} + (in (do [! try.monad] [output (\ ! each (for {@.old (|>> (:as java/lang/String) java/lang/String::trim (:as Text)) @@ -186,7 +186,7 @@ (\ async.monad in)) (#.Item repository alternatives) - (do {! async.monad} + (do [! async.monad] [_ (..announce_fetching console repository (value@ #//.artifact dependency)) outcome (..one repository dependency)] (case outcome @@ -223,7 +223,7 @@ failures tail resolution) - _ (do {! async.monad} + _ (do [! async.monad] [?package (case (dictionary.value head resolution) (#.Some package) (in (#try.Success package)) diff --git a/stdlib/source/program/aedifex/input.lux b/stdlib/source/program/aedifex/input.lux index 0305e30d8..5bc33377b 100644 --- a/stdlib/source/program/aedifex/input.lux +++ b/stdlib/source/program/aedifex/input.lux @@ -55,7 +55,7 @@ (\ fs read) (\ monad each (function (_ it) - (do {! try.monad} + (do [! try.monad] [it it it (..project_parser it) it (monad.each ! (//project.profile it) profiles)] diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux index 79b9d66dc..6f8ceb41c 100644 --- a/stdlib/source/program/aedifex/metadata/snapshot.lux +++ b/stdlib/source/program/aedifex/metadata/snapshot.lux @@ -87,7 +87,7 @@ (def: .public parser (Parser Metadata) (<| (.node ..) - (do {! <>.monad} + (do [! <>.monad] [group (.somewhere (..text ..)) name (.somewhere (..text ..)) version (.somewhere (..text ..)) diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux index 315021712..c2a4c2754 100644 --- a/stdlib/source/program/aedifex/parser.lux +++ b/stdlib/source/program/aedifex/parser.lux @@ -81,7 +81,7 @@ (def: license (Parser /.License) - (do {! <>.monad} + (do [! <>.monad] [input (\ ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text @@ -96,7 +96,7 @@ (def: organization (Parser /.Organization) - (do {! <>.monad} + (do [! <>.monad] [input (\ ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text @@ -107,7 +107,7 @@ (def: developer (Parser /.Developer) - (do {! <>.monad} + (do [! <>.monad] [input (\ ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text @@ -124,7 +124,7 @@ (def: info (Parser /.Info) - (do {! <>.monad} + (do [! <>.monad] [input (\ ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text @@ -180,7 +180,7 @@ (def: profile (Parser /.Profile) - (do {! <>.monad} + (do [! <>.monad] [input (\ ! each (dictionary.of_list text.hash) (.tuple (<>.some (<>.and .text diff --git a/stdlib/source/program/aedifex/pom.lux b/stdlib/source/program/aedifex/pom.lux index b116e45bc..87a070f08 100644 --- a/stdlib/source/program/aedifex/pom.lux +++ b/stdlib/source/program/aedifex/pom.lux @@ -156,7 +156,7 @@ (def: property_parser (Parser [Tag Text]) - (do {! <>.monad} + (do [! <>.monad] [tag .tag] (<| (.node tag) (\ ! each (|>> [tag])) @@ -164,7 +164,7 @@ (def: (dependency_parser own_version parent_version) (-> Text Text (Parser Dependency)) - (do {! <>.monad} + (do [! <>.monad] [properties (\ ! each (dictionary.of_list name.hash) (<| (.node ["" ..dependency_tag]) (<>.some ..property_parser)))] @@ -212,7 +212,7 @@ (def: .public parser (Parser /.Profile) - (do {! <>.monad} + (do [! <>.monad] [own_version (<>.else "" (.somewhere ..own_version)) parent_version (<>.else "" (.somewhere ..parent_version))] (<| (.node ["" ..project_tag]) diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux index a1c354cb9..f497b499d 100644 --- a/stdlib/source/program/aedifex/project.lux +++ b/stdlib/source/program/aedifex/project.lux @@ -60,7 +60,7 @@ (exception.except ..circular_dependency [ouroboros name]) #.None - (do {! try.monad} + (do [! try.monad] [parents (monad.each ! (profile' (set.has name lineage) project) (value@ #//.parents profile))] (in (list\mix (function (_ parent child) diff --git a/stdlib/source/program/aedifex/repository.lux b/stdlib/source/program/aedifex/repository.lux index 50a473b82..04eb87356 100644 --- a/stdlib/source/program/aedifex/repository.lux +++ b/stdlib/source/program/aedifex/repository.lux @@ -54,7 +54,7 @@ (def: (download uri) (stm.commit! - (do {! stm.monad} + (do [! stm.monad] [|state| (stm.read state)] (case (\ mock on_download uri |state|) (#try.Success [|state| output]) @@ -67,7 +67,7 @@ (def: (upload uri content) (stm.commit! - (do {! stm.monad} + (do [! stm.monad] [|state| (stm.read state)] (case (\ mock on_upload uri content |state|) (#try.Success |state|) diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux index d10296714..4a2837672 100644 --- a/stdlib/source/program/aedifex/repository/local.lux +++ b/stdlib/source/program/aedifex/repository/local.lux @@ -47,7 +47,7 @@ (\ fs read))) (def: (upload uri content) - (do {! async.monad} + (do [! async.monad] [.let [absolute_path (..absolute_path program (\ fs separator) uri)] ? (\ fs file? absolute_path) _ (if ? diff --git a/stdlib/source/program/aedifex/repository/remote.lux b/stdlib/source/program/aedifex/repository/remote.lux index 00ac66517..ea8952bef 100644 --- a/stdlib/source/program/aedifex/repository/remote.lux +++ b/stdlib/source/program/aedifex/repository/remote.lux @@ -60,7 +60,7 @@ (def: description address) (def: (download uri) - (do {! (try.with io.monad)} + (do [! (try.with io.monad)] [[status message] (: (IO (Try (@http.Response IO))) (http.get (format address uri) (http.headers ..base_headers) diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux index 90e5534f9..0fbfeb6fb 100644 --- a/stdlib/source/program/compositor.lux +++ b/stdlib/source/program/compositor.lux @@ -95,7 +95,7 @@ (def: (load_host_dependencies fs host_dependencies) (-> (file.System Async) (List file.Path) (Async (Try (Dictionary file.Path Binary)))) - (do {! (try.with async.monad)} + (do [! (try.with async.monad)] [] (loop [pending host_dependencies output (: (Dictionary file.Path Binary) @@ -128,7 +128,7 @@ Service [Packager file.Path] (Async Any))) - (do {! async.monad} + (do [! async.monad] [platform (async.future platform)] (case service (#/cli.Compilation compilation) @@ -176,7 +176,7 @@ ... TODO: Fix the interpreter... (undefined) ... (<| (or_crash! "Interpretation failed:") - ... (do {! async.monad} + ... (do [! async.monad] ... [console (|> console.default ... async.future ... (\ ! each (|>> try.trusted console.async)))] diff --git a/stdlib/source/program/compositor/export.lux b/stdlib/source/program/compositor/export.lux index 49169526d..e2d89879a 100644 --- a/stdlib/source/program/compositor/export.lux +++ b/stdlib/source/program/compositor/export.lux @@ -64,7 +64,7 @@ (def: .public (export fs [sources target]) (-> (file.System Async) Export (Async (Try Any))) - (do {! (try.with async.monad)} + (do [! (try.with async.monad)] [tar (\ ! each (binary.result tar.writer) (..library fs sources))] (|> ..file diff --git a/stdlib/source/program/scriptum.lux b/stdlib/source/program/scriptum.lux index d61e32ce0..187173782 100644 --- a/stdlib/source/program/scriptum.lux +++ b/stdlib/source/program/scriptum.lux @@ -383,7 +383,7 @@ (def: (document_types module types) (-> Text (List Value) (Meta (Markdown Block))) - (do {! meta.monad} + (do [! meta.monad] [type_docs (monad.each ! (: (-> Value (Meta (Markdown Block))) (function (_ [name def_annotations type]) @@ -503,7 +503,7 @@ ... []))))) ... (macro: (gen_documentation! _) -... (do {! meta.monad} +... (do [! meta.monad] ... [all_modules meta.modules ... .let [lux_modules (|> all_modules ... (list.only (function.composite lux_module? product.left)) -- cgit v1.2.3