diff options
author | Eduardo Julian | 2021-07-25 03:12:17 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-07-25 03:12:17 -0400 |
commit | 62b3abfcc014ca1c19d62aacdd497f6a250b372c (patch) | |
tree | c23155ecef6018b78b349f0ba6cd238872b24da7 /stdlib/source/program/aedifex | |
parent | 0f545b7e57d2564e351d907befd2ce26900c5521 (diff) |
Better syntax for "library/lux.^multi".
Diffstat (limited to 'stdlib/source/program/aedifex')
-rw-r--r-- | stdlib/source/program/aedifex/artifact/time.lux | 6 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/command/build.lux | 14 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/command/deps.lux | 4 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/dependency/deployment.lux | 4 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/input.lux | 8 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/metadata/artifact.lux | 4 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/parser.lux | 24 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/pom.lux | 24 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/project.lux | 2 | ||||
-rw-r--r-- | stdlib/source/program/aedifex/runtime.lux | 2 |
10 files changed, 46 insertions, 46 deletions
diff --git a/stdlib/source/program/aedifex/artifact/time.lux b/stdlib/source/program/aedifex/artifact/time.lux index ec7ddc4a9..524b68bb1 100644 --- a/stdlib/source/program/aedifex/artifact/time.lux +++ b/stdlib/source/program/aedifex/artifact/time.lux @@ -29,10 +29,10 @@ (def: #export (instant time) (-> Time Instant) (let [[date time] time] - (instant.from_date_time (/date.value date) - time))) + (instant.of_date_time (/date.value date) + time))) -(def: #export (from_instant instant) +(def: #export (of_instant instant) (-> Instant (Try Time)) (do try.monad [date (/date.date (instant.date instant))] diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index 17301333a..52804be43 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -84,8 +84,8 @@ (def: (remove_dependency dependency) (-> Dependency (-> Resolution Resolution)) (|>> dictionary.entries - (list.filter (|>> product.left (is? dependency) not)) - (dictionary.from_list ///dependency.hash))) + (list.only (|>> product.left (is? dependency) not)) + (dictionary.of_list ///dependency.hash))) (def: (compiler resolution compiler_dependency) (-> Resolution Dependency (Try [Resolution Compiler])) @@ -122,8 +122,8 @@ (def: (libraries fs home) (All [!] (-> (file.System !) Path Resolution (List Path))) (|>> dictionary.keys - (list.filter (|>> (get@ #///dependency.type) - (text\= ///artifact/type.lux_library))) + (list.only (|>> (get@ #///dependency.type) + (text\= ///artifact/type.lux_library))) (list\map (..path fs home)))) (def: version_separator @@ -157,9 +157,9 @@ (def: #export (host_dependencies fs home) (All [!] (-> (file.System !) Path Resolution (List Path))) (|>> dictionary.keys - (list.filter (|>> (get@ #///dependency.type) - (text\= ///artifact/type.lux_library) - not)) + (list.only (|>> (get@ #///dependency.type) + (text\= ///artifact/type.lux_library) + not)) (list\fold (function (_ dependency uniques) (let [artifact (get@ #///dependency.artifact dependency) identity [(get@ #///artifact.group artifact) diff --git a/stdlib/source/program/aedifex/command/deps.lux b/stdlib/source/program/aedifex/command/deps.lux index c2344ea80..a7db4af20 100644 --- a/stdlib/source/program/aedifex/command/deps.lux +++ b/stdlib/source/program/aedifex/command/deps.lux @@ -65,8 +65,8 @@ (list.sort (\ ///dependency.order <)) (exception.enumerate ..format))] ["Remote successes" (|> remote_successes - (set.from_list ///dependency.hash) - (set.difference (set.from_list ///dependency.hash local_successes)) + (set.of_list ///dependency.hash) + (set.difference (set.of_list ///dependency.hash local_successes)) set.to_list (list.sort (\ ///dependency.order <)) (exception.enumerate ..format))] diff --git a/stdlib/source/program/aedifex/dependency/deployment.lux b/stdlib/source/program/aedifex/dependency/deployment.lux index 7939173dd..150055cf3 100644 --- a/stdlib/source/program/aedifex/dependency/deployment.lux +++ b/stdlib/source/program/aedifex/dependency/deployment.lux @@ -90,7 +90,7 @@ (-> Dependency Instant Metadata (Try Metadata)) (do try.monad [now (: (Try ///artifact/time.Time) - (///artifact/time.from_instant now)) + (///artifact/time.of_instant now)) #let [version_template (get@ #///artifact.version artifact) snapshot (|> snapshot (update@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] @@ -146,4 +146,4 @@ (|> (dictionary.entries resolution) (monad.map ! (function (_ [dependency package]) (..one repository dependency package))) - (\ ! map (set.from_list ///artifact.hash))))) + (\ ! map (set.of_list ///artifact.hash))))) diff --git a/stdlib/source/program/aedifex/input.lux b/stdlib/source/program/aedifex/input.lux index 1ece2cf17..73b3c383b 100644 --- a/stdlib/source/program/aedifex/input.lux +++ b/stdlib/source/program/aedifex/input.lux @@ -27,7 +27,7 @@ ["#." project (#+ Project)] ["#." parser]]) -(def: (parse_lux source_code) +(def: (lux_parser source_code) (-> Text (Try Code)) (let [parse (syntax.parse "" syntax.no_aliases @@ -39,11 +39,11 @@ (#.Right [_ lux_code]) (#try.Success lux_code)))) -(def: parse_project +(def: project_parser (-> Binary (Try Project)) (|>> (do> try.monad [(\ utf8.codec decode)] - [..parse_lux] + [..lux_parser] [(list) (<code>.run //parser.project)]))) (def: #export (read monad fs profile) @@ -52,5 +52,5 @@ (\ fs read) (\ monad map (|>> (do> try.monad [] - [..parse_project] + [..project_parser] [(//project.profile profile)]))))) diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux index 0f8a5737c..524272559 100644 --- a/stdlib/source/program/aedifex/metadata/artifact.lux +++ b/stdlib/source/program/aedifex/metadata/artifact.lux @@ -138,7 +138,7 @@ (<text>.embed (do <>.monad [date ..date_parser time ..time_parser] - (wrap (instant.from_date_time date time))) + (wrap (instant.of_date_time date time))) (..text ..<last_updated>))) (def: #export parser @@ -170,7 +170,7 @@ (def: epoch Instant - (instant.from_millis +0)) + (instant.of_millis +0)) (def: #export (read repository artifact) (-> (Repository Promise) Artifact (Promise (Try Metadata))) diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux index d0dd59133..ca5fe3be3 100644 --- a/stdlib/source/program/aedifex/parser.lux +++ b/stdlib/source/program/aedifex/parser.lux @@ -83,7 +83,7 @@ (Parser /.License) (do {! <>.monad} [input (\ ! map - (dictionary.from_list text.hash) + (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any))))] ($_ <>.and @@ -98,7 +98,7 @@ (Parser /.Organization) (do {! <>.monad} [input (\ ! map - (dictionary.from_list text.hash) + (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any))))] ($_ <>.and @@ -109,7 +109,7 @@ (Parser /.Developer) (do {! <>.monad} [input (\ ! map - (dictionary.from_list text.hash) + (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any))))] ($_ <>.and @@ -126,7 +126,7 @@ (Parser /.Info) (do {! <>.monad} [input (\ ! map - (dictionary.from_list text.hash) + (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any))))] ($_ <>.and @@ -182,7 +182,7 @@ (Parser /.Profile) (do {! <>.monad} [input (\ ! map - (dictionary.from_list text.hash) + (dictionary.of_list text.hash) (<code>.record (<>.some (<>.and <code>.local_tag <code>.any)))) #let [^parents (: (Parser (List /.Name)) @@ -196,20 +196,20 @@ (..singular input "info" ..info))) ^repositories (: (Parser (Set //repository.Address)) (|> (..plural input "repositories" ..repository) - (\ ! map (set.from_list text.hash)) + (\ ! map (set.of_list text.hash)) (<>.default (set.new text.hash)) (\ ! map (set.add /.default_repository)))) ^dependencies (: (Parser (Set //dependency.Dependency)) (|> (..plural input "dependencies" ..dependency) - (\ ! map (set.from_list //dependency.hash)) + (\ ! map (set.of_list //dependency.hash)) (<>.default (set.new //dependency.hash)))) ^compiler (|> ..dependency (..singular input "compiler") (<>.default /.default_compiler)) ^sources (: (Parser (Set /.Source)) (|> (..plural input "sources" ..source) - (\ ! map (set.from_list text.hash)) - (<>.default (set.from_list text.hash (list /.default_source))))) + (\ ! map (set.of_list text.hash)) + (<>.default (set.of_list text.hash (list /.default_source))))) ^target (: (Parser /.Target) (|> ..target (..singular input "target") @@ -221,7 +221,7 @@ (<>.maybe (..singular input "test" ..module))) ^deploy_repositories (: (Parser (Dictionary Text //repository.Address)) - (<| (\ ! map (dictionary.from_list text.hash)) + (<| (\ ! map (dictionary.of_list text.hash)) (<>.default (list)) (..singular input "deploy_repositories" ..deploy_repository))) ^java (|> ..runtime @@ -262,11 +262,11 @@ (Parser Project) (let [default_profile (: (Parser Project) (\ <>.monad map - (|>> [/.default] (list) (dictionary.from_list text.hash)) + (|>> [/.default] (list) (dictionary.of_list text.hash)) ..profile)) multi_profile (: (Parser Project) (\ <>.monad map - (dictionary.from_list text.hash) + (dictionary.of_list text.hash) (<code>.record (<>.many (<>.and <code>.text ..profile)))))] (<>.either multi_profile diff --git a/stdlib/source/program/aedifex/pom.lux b/stdlib/source/program/aedifex/pom.lux index be03d36f5..b458c7a21 100644 --- a/stdlib/source/program/aedifex/pom.lux +++ b/stdlib/source/program/aedifex/pom.lux @@ -154,7 +154,7 @@ _ (exception.throw /.no_identity []))) -(def: parse_property +(def: property_parser (Parser [Tag Text]) (do {! <>.monad} [tag <xml>.tag] @@ -162,14 +162,14 @@ (\ ! map (|>> [tag])) <xml>.text))) -(def: (parse_dependency own_version parent_version) +(def: (dependency_parser own_version parent_version) (-> Text Text (Parser Dependency)) (do {! <>.monad} - [properties (\ ! map (dictionary.from_list name.hash) + [properties (\ ! map (dictionary.of_list name.hash) (<| (<xml>.node ["" ..dependency_tag]) - (<>.some ..parse_property)))] + (<>.some ..property_parser)))] (<| <>.lift - try.from_maybe + try.of_maybe (do maybe.monad [group (dictionary.get ["" ..group_tag] properties) artifact (dictionary.get ["" ..artifact_tag] properties)] @@ -184,21 +184,21 @@ (dictionary.get ["" "type"]) (maybe.default //artifact/type.jvm_library))}))))) -(def: (parse_dependencies own_version parent_version) +(def: (dependencies_parser own_version parent_version) (-> Text Text (Parser (List Dependency))) (<| (<xml>.node ["" ..dependencies_tag]) - (<>.some (..parse_dependency own_version parent_version)))) + (<>.some (..dependency_parser own_version parent_version)))) -(def: parse_repository +(def: repository_parser (Parser Address) (<| (<xml>.node ["" ..repository_tag]) (<xml>.node ["" ..url_tag]) <xml>.text)) -(def: parse_repositories +(def: repositories_parser (Parser (List Address)) (<| (<xml>.node ["" ..repositories_tag]) - (<>.some ..parse_repository))) + (<>.some ..repository_parser))) (def: own_version (Parser Text) @@ -217,10 +217,10 @@ parent_version (<>.default "" (<xml>.somewhere ..parent_version))] (<| (<xml>.node ["" ..project_tag]) (do ! - [dependencies (|> (..parse_dependencies own_version parent_version) + [dependencies (|> (..dependencies_parser own_version parent_version) <xml>.somewhere (<>.default (list))) - repositories (|> ..parse_repositories + repositories (|> ..repositories_parser <xml>.somewhere (<>.default (list))) _ (<>.some <xml>.ignore)] diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux index 321e86661..d845ed689 100644 --- a/stdlib/source/program/aedifex/project.lux +++ b/stdlib/source/program/aedifex/project.lux @@ -26,7 +26,7 @@ (def: #export (project name profile) (-> Name Profile Project) - (dictionary.from_list text.hash (list [name profile]))) + (dictionary.of_list text.hash (list [name profile]))) (def: #export equivalence (Equivalence Project) diff --git a/stdlib/source/program/aedifex/runtime.lux b/stdlib/source/program/aedifex/runtime.lux index e6b61d360..ea34fc0fe 100644 --- a/stdlib/source/program/aedifex/runtime.lux +++ b/stdlib/source/program/aedifex/runtime.lux @@ -28,7 +28,7 @@ [(def: #export <name> Runtime {#program <command> - #parameters (`` (list (~~ (template.splice <parameters>))))})] + #parameters (`` (list (~~ (template.spliced <parameters>))))})] [default_java "java" ["-jar"]] [default_js "node" ["--stack_size=8192"]] |