diff options
author | Eduardo Julian | 2021-08-24 05:23:45 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-24 05:23:45 -0400 |
commit | 36303d6cb2ce3ab9e36d045b9516c997bd461862 (patch) | |
tree | b9d2f1495143054d61d9af129f36833624db9dac /stdlib/source/program/aedifex | |
parent | ec1f31b5a1492d5e0ab260397291d4449483bbd9 (diff) |
Outsourced the syntax for labelled type definitions to macros.
Diffstat (limited to 'stdlib/source/program/aedifex')
21 files changed, 94 insertions, 94 deletions
diff --git a/stdlib/source/program/aedifex/artifact.lux b/stdlib/source/program/aedifex/artifact.lux index 6fd2d495f..8aca29ea0 100644 --- a/stdlib/source/program/aedifex/artifact.lux +++ b/stdlib/source/program/aedifex/artifact.lux @@ -101,8 +101,8 @@ (def: .public (local artifact) (-> Artifact (List Text)) - (list\compose (|> artifact - (value@ #group) - (text.all_split_by ..group_separator)) - (list (value@ #name artifact) - (value@ #version artifact)))) + (list\composite (|> artifact + (value@ #group) + (text.all_split_by ..group_separator)) + (list (value@ #name artifact) + (value@ #version artifact)))) diff --git a/stdlib/source/program/aedifex/artifact/versioning.lux b/stdlib/source/program/aedifex/artifact/versioning.lux index 9f9963731..886e89491 100644 --- a/stdlib/source/program/aedifex/artifact/versioning.lux +++ b/stdlib/source/program/aedifex/artifact/versioning.lux @@ -66,7 +66,7 @@ (list (//snapshot.format snapshot) (..last_updated_format last_updated) (|> versions - (list\map //snapshot/version.format) + (list\each //snapshot/version.format) (#xml.Node ..<snapshot_versions> xml.attributes))))) (def: (text tag) diff --git a/stdlib/source/program/aedifex/cli.lux b/stdlib/source/program/aedifex/cli.lux index 7f9fe61ff..87ad9938a 100644 --- a/stdlib/source/program/aedifex/cli.lux +++ b/stdlib/source/program/aedifex/cli.lux @@ -92,6 +92,6 @@ ($_ <>.and cli.any ..command')) - (\ <>.monad map (|>> [/.default]) + (\ <>.monad each (|>> [/.default]) ..command') )) diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux index 0a1998730..77a0c8714 100644 --- a/stdlib/source/program/aedifex/command/auto.lux +++ b/stdlib/source/program/aedifex/command/auto.lux @@ -30,10 +30,10 @@ (let [! async.monad] (|> path (\ fs sub_directories) - (\ ! map (|>> (try.else (list)) - (monad.map ! (targets fs)))) - (\ ! join) - (\ ! map (|>> list.together (list& path)))))) + (\ ! each (|>> (try.else (list)) + (monad.each ! (targets fs)))) + (\ ! conjoint) + (\ ! each (|>> list.together (list& path)))))) (def: .public delay Nat @@ -55,10 +55,10 @@ [targets (|> profile (value@ #///.sources) set.list - (monad.map ! (..targets fs)) - (\ ! map list.together))] + (monad.each ! (..targets fs)) + (\ ! each list.together))] (do {! ///action.monad} - [_ (monad.map ! (\ watcher start watch.modification) targets) + [_ (monad.each ! (\ watcher start watch.modification) targets) _ <call>] (loop [_ []] (do ! diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index d3c5b17a0..bf7c95870 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -123,7 +123,7 @@ (|>> dictionary.keys (list.only (|>> (value@ #///dependency.type) (text\= ///artifact/type.lux_library))) - (list\map (..path fs home)))) + (list\each (..path fs home)))) (def: version_separator ".") @@ -175,7 +175,7 @@ (: (Dictionary [Group Name] [Version Dependency]) (dictionary.empty (product.hash text.hash text.hash)))) dictionary.values - (list\map (|>> product.right (..path fs home))))) + (list\each (|>> product.right (..path fs home))))) (def: (singular name) (-> Text Text (List Text)) @@ -183,7 +183,7 @@ (def: (plural name) (-> Text (List Text) (List Text)) - (|>> (list\map (|>> (list name))) list.together)) + (|>> (list\each (|>> (list name))) list.together)) (def: .public start "[BUILD STARTED]") (def: .public success "[BUILD ENDED]") diff --git a/stdlib/source/program/aedifex/command/clean.lux b/stdlib/source/program/aedifex/command/clean.lux index 9e55ccc83..5ff16928f 100644 --- a/stdlib/source/program/aedifex/command/clean.lux +++ b/stdlib/source/program/aedifex/command/clean.lux @@ -23,8 +23,8 @@ (let [! ///action.monad] (|> root (\ fs directory_files) - (\ ! map (monad.map ! (\ fs delete))) - (\ ! join)))) + (\ ! each (monad.each ! (\ fs delete))) + (\ ! conjoint)))) (def: .public success (-> ///.Target Text) @@ -42,8 +42,8 @@ [_ (..clean_files! fs root) _ (|> root (\ fs sub_directories) - (\ ! map (monad.map ! recur)) - (\ ! join))] + (\ ! each (monad.each ! recur)) + (\ ! conjoint))] (\ fs delete root))) (\ ! in [])))] (console.write_line (..success target) console))) diff --git a/stdlib/source/program/aedifex/command/deploy.lux b/stdlib/source/program/aedifex/command/deploy.lux index 62ec8e985..fc0562699 100644 --- a/stdlib/source/program/aedifex/command/deploy.lux +++ b/stdlib/source/program/aedifex/command/deploy.lux @@ -63,7 +63,7 @@ (value@ #/.sources) set.list (export.library fs) - (\ ! map (binary.result tar.writer))) + (\ ! each (binary.result tar.writer))) pom (\ async.monad in (///pom.write profile)) _ (///dependency/deployment.one repository diff --git a/stdlib/source/program/aedifex/command/pom.lux b/stdlib/source/program/aedifex/command/pom.lux index c43982a98..9c449a0b9 100644 --- a/stdlib/source/program/aedifex/command/pom.lux +++ b/stdlib/source/program/aedifex/command/pom.lux @@ -29,8 +29,8 @@ (-> (Console Async) (file.System Async) (Command Any)) (do ///action.monad [content (|> (///pom.write profile) - (try\map (|>> (\ xml.codec encoded) - (\ utf8.codec encoded))) + (try\each (|>> (\ xml.codec encoded) + (\ utf8.codec encoded))) async\in) _ (\ fs write content ///pom.file)] (console.write_line ..success console))) diff --git a/stdlib/source/program/aedifex/dependency/deployment.lux b/stdlib/source/program/aedifex/dependency/deployment.lux index c637ae931..22788dc3d 100644 --- a/stdlib/source/program/aedifex/dependency/deployment.lux +++ b/stdlib/source/program/aedifex/dependency/deployment.lux @@ -111,8 +111,8 @@ #///artifact/snapshot/version/value.snapshot versioning_snapshot}) #///artifact/snapshot/version.updated now})) ... (with@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] - ... (list\compose (..artifacts type (product.right (value@ #///package.library package))) - ... (..artifacts ///artifact/type.pom (product.right (value@ #///package.pom package))))) + ... (list\composite (..artifacts type (product.right (value@ #///package.library package))) + ... (..artifacts ///artifact/type.pom (product.right (value@ #///package.pom package))))) )))) (def: .public (one repository [artifact type] package) @@ -144,6 +144,6 @@ (-> (Repository Async) Resolution (Async (Try (Set Artifact)))) (let [! (try.with async.monad)] (|> (dictionary.entries resolution) - (monad.map ! (function (_ [dependency package]) - (..one repository dependency package))) - (\ ! map (set.of_list ///artifact.hash))))) + (monad.each ! (function (_ [dependency package]) + (..one repository dependency package))) + (\ ! 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 50415b61f..8de6d2423 100644 --- a/stdlib/source/program/aedifex/dependency/resolution.lux +++ b/stdlib/source/program/aedifex/dependency/resolution.lux @@ -84,10 +84,10 @@ (case ?actual (#try.Success actual) (in (do {! try.monad} - [output (\ ! map (for {@.old (|>> (:as java/lang/String) - java/lang/String::trim - (:as Text)) - @.jvm (|>> java/lang/String::trim)}) + [output (\ ! each (for {@.old (|>> (:as java/lang/String) + java/lang/String::trim + (:as Text)) + @.jvm (|>> java/lang/String::trim)}) (\ utf8.codec decoded actual)) actual (|> output (text.all_split_by " ") @@ -234,15 +234,15 @@ (do ! [.let [sub_dependencies (|> package ///package.dependencies - (try\map set.list) + (try\each set.list) (try.else (list))) ... For security reasons, it's not a good idea to allow dependencies to introduce repositories. ... package_repositories (|> package ... ///package.repositories - ... (try\map set.list) + ... (try\each set.list) ... (try.else (list)) - ... (list\map new_repository)) - ... sub_repositories (list\compose repositories package_repositories) + ... (list\each new_repository)) + ... sub_repositories (list\composite repositories package_repositories) sub_repositories repositories] [successes failures resolution] (recur sub_repositories (#.Item head successes) diff --git a/stdlib/source/program/aedifex/format.lux b/stdlib/source/program/aedifex/format.lux index 74583c8f5..d36d597b3 100644 --- a/stdlib/source/program/aedifex/format.lux +++ b/stdlib/source/program/aedifex/format.lux @@ -59,8 +59,8 @@ (def: aggregate (Format Aggregate) (|>> dictionary.entries - (list\map (function (_ [key value]) - [(code.local_tag key) value])) + (list\each (function (_ [key value]) + [(code.local_tag key) value])) code.record)) (def: empty @@ -85,7 +85,7 @@ aggregate value - (dictionary.has field (` [(~+ (list\map format value))]) aggregate))) + (dictionary.has field (` [(~+ (list\each format value))]) aggregate))) (def: (on_set field value format aggregate) (All [a] @@ -100,8 +100,8 @@ (dictionary.has field (|> value dictionary.entries - (list\map (function (_ [key value]) - [(key_format key) (value_format value)])) + (list\each (function (_ [key value]) + [(key_format key) (value_format value)])) code.record) aggregate))) @@ -137,7 +137,7 @@ (def: (runtime [program parameters]) (Format Runtime) (` [(~ (code.text program)) - (~+ (list\map code.text parameters))])) + (~+ (list\each code.text parameters))])) (def: .public (profile value) (Format /.Profile) @@ -166,6 +166,6 @@ (def: .public project (Format Project) (|>> dictionary.entries - (list\map (function (_ [key value]) - [(code.text key) (..profile value)])) + (list\each (function (_ [key value]) + [(code.text key) (..profile value)])) code.record)) diff --git a/stdlib/source/program/aedifex/input.lux b/stdlib/source/program/aedifex/input.lux index b78e502a6..27591c709 100644 --- a/stdlib/source/program/aedifex/input.lux +++ b/stdlib/source/program/aedifex/input.lux @@ -50,7 +50,7 @@ (All [!] (-> (Monad !) (file.System !) Text (! (Try Profile)))) (|> //project.file (\ fs read) - (\ monad map (|>> (do> try.monad - [] - [..project_parser] - [(//project.profile profile)]))))) + (\ monad each (|>> (do> try.monad + [] + [..project_parser] + [(//project.profile profile)]))))) diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux index d8134515c..85fe747bd 100644 --- a/stdlib/source/program/aedifex/metadata/artifact.lux +++ b/stdlib/source/program/aedifex/metadata/artifact.lux @@ -93,7 +93,7 @@ (def: versions_format (-> (List Version) XML) - (|>> (list\map ..version_format) (#xml.Node ..<versions> xml.attributes))) + (|>> (list\each ..version_format) (#xml.Node ..<versions> xml.attributes))) (def: .public (format value) (-> Metadata XML) diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux index 3852f5fe1..3a3464cd6 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}] (|> (<xml>.somewhere ///artifact/versioning.parser) - (\ ! map + (\ ! each (revised@ #///artifact/versioning.versions (: (-> (List ///artifact/snapshot/version.Version) (List ///artifact/snapshot/version.Version)) diff --git a/stdlib/source/program/aedifex/package.lux b/stdlib/source/program/aedifex/package.lux index 7611cdac9..6a3a71f6d 100644 --- a/stdlib/source/program/aedifex/package.lux +++ b/stdlib/source/program/aedifex/package.lux @@ -65,7 +65,7 @@ product.left list (<xml>.result //pom.parser) - (try\map (value@ #/.dependencies)))) + (try\each (value@ #/.dependencies)))) (def: .public repositories (-> Package (Try (Set Address))) @@ -73,7 +73,7 @@ product.left list (<xml>.result //pom.parser) - (try\map (value@ #/.repositories)))) + (try\each (value@ #/.repositories)))) (def: .public equivalence (Equivalence Package) diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux index d5f4d3bb8..8ece73b51 100644 --- a/stdlib/source/program/aedifex/parser.lux +++ b/stdlib/source/program/aedifex/parser.lux @@ -82,7 +82,7 @@ (def: license (Parser /.License) (do {! <>.monad} - [input (\ ! map + [input (\ ! each (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any))))] @@ -97,7 +97,7 @@ (def: organization (Parser /.Organization) (do {! <>.monad} - [input (\ ! map + [input (\ ! each (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any))))] @@ -108,7 +108,7 @@ (def: developer (Parser /.Developer) (do {! <>.monad} - [input (\ ! map + [input (\ ! each (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any))))] @@ -125,7 +125,7 @@ (def: info (Parser /.Info) (do {! <>.monad} - [input (\ ! map + [input (\ ! each (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any))))] @@ -181,7 +181,7 @@ (def: profile (Parser /.Profile) (do {! <>.monad} - [input (\ ! map + [input (\ ! each (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any)))) @@ -196,19 +196,19 @@ (..singular input "info" ..info))) ^repositories (: (Parser (Set //repository.Address)) (|> (..plural input "repositories" ..repository) - (\ ! map (set.of_list text.hash)) + (\ ! each (set.of_list text.hash)) (<>.else (set.empty text.hash)) - (\ ! map (set.has /.default_repository)))) + (\ ! each (set.has /.default_repository)))) ^dependencies (: (Parser (Set //dependency.Dependency)) (|> (..plural input "dependencies" ..dependency) - (\ ! map (set.of_list //dependency.hash)) + (\ ! each (set.of_list //dependency.hash)) (<>.else (set.empty //dependency.hash)))) ^compiler (|> ..dependency (..singular input "compiler") (<>.else /.default_compiler)) ^sources (: (Parser (Set /.Source)) (|> (..plural input "sources" ..source) - (\ ! map (set.of_list text.hash)) + (\ ! each (set.of_list text.hash)) (<>.else (set.of_list text.hash (list /.default_source))))) ^target (: (Parser /.Target) (|> ..target @@ -221,7 +221,7 @@ (<>.maybe (..singular input "test" ..module))) ^deploy_repositories (: (Parser (Dictionary Text //repository.Address)) - (<| (\ ! map (dictionary.of_list text.hash)) + (<| (\ ! each (dictionary.of_list text.hash)) (<>.else (list)) (..singular input "deploy_repositories" ..deploy_repository))) ^java (|> ..runtime @@ -261,11 +261,11 @@ (def: .public project (Parser Project) (let [default_profile (: (Parser Project) - (\ <>.monad map + (\ <>.monad each (|>> [/.default] (list) (dictionary.of_list text.hash)) ..profile)) multi_profile (: (Parser Project) - (\ <>.monad map + (\ <>.monad each (dictionary.of_list text.hash) (<code>.record (<>.many (<>.and <code>.text ..profile)))))] diff --git a/stdlib/source/program/aedifex/pom.lux b/stdlib/source/program/aedifex/pom.lux index 7f9464e5c..a093a4091 100644 --- a/stdlib/source/program/aedifex/pom.lux +++ b/stdlib/source/program/aedifex/pom.lux @@ -85,8 +85,8 @@ (-> Dependency XML) (#_.Node ["" ..dependency_tag] _.attributes - (list\compose (..artifact (value@ #//dependency.artifact value)) - (list (..property "type" (value@ #//dependency.type value)))))) + (list\composite (..artifact (value@ #//dependency.artifact value)) + (list (..property "type" (value@ #//dependency.type value)))))) (def: (group tag) (-> Text (-> (List XML) XML)) @@ -114,7 +114,7 @@ (-> /.Developer (List XML)) (list& (..property "name" name) (..property "email" email) - (|> organization (maybe\map ..developer_organization) (maybe.else (list))))) + (|> organization (maybe\each ..developer_organization) (maybe.else (list))))) (template [<name> <type> <tag>] [(def: <name> @@ -127,14 +127,14 @@ (def: (info value) (-> /.Info (List XML)) - ($_ list\compose - (|> value (value@ #/.url) (maybe\map (..property ..url_tag)) maybe.list) - (|> value (value@ #/.description) (maybe\map (..property "description")) maybe.list) - (|> value (value@ #/.licenses) (list\map ..license) (..group "licenses") list) - (|> value (value@ #/.scm) (maybe\map ..scm) maybe.list) - (|> value (value@ #/.organization) (maybe\map ..organization) maybe.list) - (|> value (value@ #/.developers) (list\map ..developer) (..group "developers") list) - (|> value (value@ #/.contributors) (list\map ..contributor) (..group "contributors") list) + ($_ list\composite + (|> value (value@ #/.url) (maybe\each (..property ..url_tag)) maybe.list) + (|> value (value@ #/.description) (maybe\each (..property "description")) maybe.list) + (|> value (value@ #/.licenses) (list\each ..license) (..group "licenses") list) + (|> value (value@ #/.scm) (maybe\each ..scm) maybe.list) + (|> value (value@ #/.organization) (maybe\each ..organization) maybe.list) + (|> value (value@ #/.developers) (list\each ..developer) (..group "developers") list) + (|> value (value@ #/.contributors) (list\each ..contributor) (..group "contributors") list) )) ) @@ -144,11 +144,11 @@ (#.Some identity) (#try.Success (#_.Node ["" ..project_tag] _.attributes - ($_ list\compose + ($_ list\composite (list ..version) (..artifact identity) - (|> value (value@ #/.repositories) set.list (list\map ..repository) (..group "repositories") list) - (|> value (value@ #/.dependencies) set.list (list\map ..dependency) (..group ..dependencies_tag) list) + (|> value (value@ #/.repositories) set.list (list\each ..repository) (..group "repositories") list) + (|> value (value@ #/.dependencies) set.list (list\each ..dependency) (..group ..dependencies_tag) list) ))) _ @@ -159,13 +159,13 @@ (do {! <>.monad} [tag <xml>.tag] (<| (<xml>.node tag) - (\ ! map (|>> [tag])) + (\ ! each (|>> [tag])) <xml>.text))) (def: (dependency_parser own_version parent_version) (-> Text Text (Parser Dependency)) (do {! <>.monad} - [properties (\ ! map (dictionary.of_list name.hash) + [properties (\ ! each (dictionary.of_list name.hash) (<| (<xml>.node ["" ..dependency_tag]) (<>.some ..property_parser)))] (<| <>.lifted diff --git a/stdlib/source/program/aedifex/profile.lux b/stdlib/source/program/aedifex/profile.lux index f4a1f9a0d..264bc9015 100644 --- a/stdlib/source/program/aedifex/profile.lux +++ b/stdlib/source/program/aedifex/profile.lux @@ -228,14 +228,14 @@ #lua runtime.default_lua #ruby runtime.default_ruby}) - (def: (compose override baseline) + (def: (composite override baseline) (template.let [(!runtime <tag> <runtime>) [(if (runtime\= <runtime> (value@ <tag> override)) (value@ <tag> baseline) (value@ <tag> override))]] - {#parents (list\compose (value@ #parents baseline) (value@ #parents override)) - #identity (maybe\compose (value@ #identity override) (value@ #identity baseline)) - #info (maybe\compose (value@ #info override) (value@ #info baseline)) + {#parents (list\composite (value@ #parents baseline) (value@ #parents override)) + #identity (maybe\composite (value@ #identity override) (value@ #identity baseline)) + #info (maybe\composite (value@ #info override) (value@ #info baseline)) #repositories (set.union (value@ #repositories baseline) (value@ #repositories override)) #dependencies (set.union (value@ #dependencies baseline) (value@ #dependencies override)) #compiler (if (dependency\= ..default_compiler (value@ #compiler override)) @@ -245,8 +245,8 @@ #target (if (text\= ..default_target (value@ #target baseline)) (value@ #target override) (value@ #target baseline)) - #program (maybe\compose (value@ #program override) (value@ #program baseline)) - #test (maybe\compose (value@ #test override) (value@ #test baseline)) + #program (maybe\composite (value@ #program override) (value@ #program baseline)) + #test (maybe\composite (value@ #test override) (value@ #test baseline)) #deploy_repositories (dictionary.merged (value@ #deploy_repositories override) (value@ #deploy_repositories baseline)) #java (!runtime #java runtime.default_java) #js (!runtime #js runtime.default_js) diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux index 687fd215b..4f6da6d62 100644 --- a/stdlib/source/program/aedifex/project.lux +++ b/stdlib/source/program/aedifex/project.lux @@ -38,8 +38,8 @@ (def: identity (dictionary.empty text.hash)) - (def: compose - (dictionary.merged_with (\ //.monoid compose)))) + (def: composite + (dictionary.merged_with (\ //.monoid composite)))) (exception: .public (unknown_profile {name Name}) (exception.report @@ -61,10 +61,10 @@ #.None (do {! try.monad} - [parents (monad.map ! (profile' (set.has name lineage) project) - (value@ #//.parents profile))] + [parents (monad.each ! (profile' (set.has name lineage) project) + (value@ #//.parents profile))] (in (list\mix (function (_ parent child) - (\ //.monoid compose child parent)) + (\ //.monoid composite child parent)) (with@ #//.parents (list) profile) parents)))) diff --git a/stdlib/source/program/aedifex/repository/remote.lux b/stdlib/source/program/aedifex/repository/remote.lux index 11d29716e..d6cea3f06 100644 --- a/stdlib/source/program/aedifex/repository/remote.lux +++ b/stdlib/source/program/aedifex/repository/remote.lux @@ -68,7 +68,7 @@ http))] (case status (^ (static http/status.ok)) - (\ ! map product.right ((value@ #@http.body message) #.None)) + (\ ! each product.right ((value@ #@http.body message) #.None)) _ (do ! diff --git a/stdlib/source/program/aedifex/runtime.lux b/stdlib/source/program/aedifex/runtime.lux index f029bed15..addfd4a52 100644 --- a/stdlib/source/program/aedifex/runtime.lux +++ b/stdlib/source/program/aedifex/runtime.lux @@ -42,5 +42,5 @@ (-> Runtime file.Path Runtime) (revised@ #parameters (function (_ parameters) - (list\compose parameters (list path))) + (list\composite parameters (list path))) runtime)) |