diff options
Diffstat (limited to '')
24 files changed, 232 insertions, 231 deletions
diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux index 05aee240b..4dd110551 100644 --- a/stdlib/source/program/aedifex.lux +++ b/stdlib/source/program/aedifex.lux @@ -66,7 +66,7 @@ (def: repositories (-> /.Profile (List (Repository Async))) - (|>> (get@ #/.repositories) + (|>> (value@ #/.repositories) set.list (list\map (|>> (/repository/remote.repository http.default #.None) /repository.async)))) @@ -165,20 +165,21 @@ (#/cli.Deploy repository identity) (..command - (case [(get@ #/.identity profile) - (dictionary.value repository (get@ #/.deploy_repositories profile))] - [(#.Some artifact) (#.Some repository)] - (/command/deploy.do! console - (/repository.async (/repository/remote.repository http.default (#.Some identity) repository)) - (file.async file.default) - artifact - profile) - - [#.None _] - (async\in (exception.except /.no_identity [])) - - [_ #.None] - (async\in (exception.except ..cannot_find_repository [repository (get@ #/.deploy_repositories profile)])))) + (case (value@ #/.identity profile) + (#.Some artifact) + (case (dictionary.value repository (value@ #/.deploy_repositories profile)) + (#.Some repository) + (/command/deploy.do! console + (/repository.async (/repository/remote.repository http.default (#.Some identity) repository)) + (file.async file.default) + artifact + profile) + + #.None + (async\in (exception.except ..cannot_find_repository [repository (value@ #/.deploy_repositories profile)]))) + + #.None + (async\in (exception.except /.no_identity [])))) #/cli.Dependencies (..command @@ -207,8 +208,5 @@ (..command (case auto #/cli.Build (..with_dependencies program console (/command/auto.do! /command/auto.delay watcher /command/build.do!) profile) - #/cli.Test (..with_dependencies program console (/command/auto.do! /command/auto.delay watcher /command/test.do!) profile))))) - - _ - (undefined))) + #/cli.Test (..with_dependencies program console (/command/auto.do! /command/auto.delay watcher /command/test.do!) profile))))))) )))))) diff --git a/stdlib/source/program/aedifex/artifact.lux b/stdlib/source/program/aedifex/artifact.lux index cd53db5c4..6fd2d495f 100644 --- a/stdlib/source/program/aedifex/artifact.lux +++ b/stdlib/source/program/aedifex/artifact.lux @@ -1,6 +1,6 @@ (.module: [library - [lux (#- Name) + [lux (#- Name local) [abstract [equivalence (#+ Equivalence)] [order (#+ Order)] @@ -49,18 +49,18 @@ ..equivalence) (def: (< reference subject) - (<| (or (text\< (get@ #group reference) - (get@ #group subject))) + (<| (or (text\< (value@ #group reference) + (value@ #group subject))) - (and (text\= (get@ #group reference) - (get@ #group subject))) - (or (text\< (get@ #name reference) - (get@ #name subject))) + (and (text\= (value@ #group reference) + (value@ #group subject))) + (or (text\< (value@ #name reference) + (value@ #name subject))) - (and (text\= (get@ #name reference) - (get@ #name subject))) - (text\< (get@ #version reference) - (get@ #version subject))))) + (and (text\= (value@ #name reference) + (value@ #name subject))) + (text\< (value@ #version reference) + (value@ #version subject))))) (template [<separator> <definition>] [(def: <definition> @@ -74,13 +74,13 @@ (def: .public (identity artifact) (-> Artifact Text) - (%.format (get@ #name artifact) + (%.format (value@ #name artifact) ..version_separator - (get@ #version artifact))) + (value@ #version artifact))) (def: .public (format value) (Format Artifact) - (%.format (get@ #group value) + (%.format (value@ #group value) ..identity_separator (..identity value))) @@ -93,16 +93,16 @@ (def: .public (uri version artifact) (-> Version Artifact URI) (let [/ uri.separator - group (..directory / (get@ #group artifact)) - name (get@ #name artifact) - ... version (get@ #version artifact) + group (..directory / (value@ #group artifact)) + name (value@ #name artifact) + ... version (value@ #version artifact) identity (..identity artifact)] (%.format group / name / version / identity))) (def: .public (local artifact) (-> Artifact (List Text)) (list\compose (|> artifact - (get@ #group) + (value@ #group) (text.all_split_by ..group_separator)) - (list (get@ #name artifact) - (get@ #version artifact)))) + (list (value@ #name artifact) + (value@ #version artifact)))) diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux index 805ffb1ba..0a1998730 100644 --- a/stdlib/source/program/aedifex/command/auto.lux +++ b/stdlib/source/program/aedifex/command/auto.lux @@ -33,7 +33,7 @@ (\ ! map (|>> (try.else (list)) (monad.map ! (targets fs)))) (\ ! join) - (\ ! map (|>> list.joined (list& path)))))) + (\ ! map (|>> list.together (list& path)))))) (def: .public delay Nat @@ -41,7 +41,7 @@ (def: (pause delay) (-> Nat (Async (Try Any))) - (async.delayed delay (#try.Success []))) + (async.after delay (#try.Success []))) (def: .public (do! delay watcher command) (All [a] @@ -53,10 +53,10 @@ (with_expansions [<call> ((command console program fs shell resolution) profile)] (do {! async.monad} [targets (|> profile - (get@ #///.sources) + (value@ #///.sources) set.list (monad.map ! (..targets fs)) - (\ ! map list.joined))] + (\ ! map list.together))] (do {! ///action.monad} [_ (monad.map ! (\ watcher start watch.modification) targets) _ <call>] diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux index ff469d896..e4de9ab0a 100644 --- a/stdlib/source/program/aedifex/command/build.lux +++ b/stdlib/source/program/aedifex/command/build.lux @@ -49,8 +49,8 @@ (-> Group Name Finder) (|>> dictionary.entries (list.one (function (_ [dependency package]) - (if (and (text\= group (get@ [#///dependency.artifact #///artifact.group] dependency)) - (text\= name (get@ [#///dependency.artifact #///artifact.name] dependency))) + (if (and (text\= group (value@ [#///dependency.artifact #///artifact.group] dependency)) + (text\= name (value@ [#///dependency.artifact #///artifact.name] dependency))) (#.Some dependency) #.None))))) @@ -111,17 +111,17 @@ (def: (path fs home dependency) (All [!] (-> (file.System !) Path Dependency Path)) (let [/ (\ fs separator) - artifact (get@ #///dependency.artifact dependency)] + artifact (value@ #///dependency.artifact dependency)] (|> artifact - (///local.uri (get@ #///artifact.version artifact)) + (///local.uri (value@ #///artifact.version artifact)) (text.replaced uri.separator /) (format home /) - (text.suffix (format "." (get@ #///dependency.type dependency)))))) + (text.suffix (format "." (value@ #///dependency.type dependency)))))) (def: (libraries fs home) (All [!] (-> (file.System !) Path Resolution (List Path))) (|>> dictionary.keys - (list.only (|>> (get@ #///dependency.type) + (list.only (|>> (value@ #///dependency.type) (text\= ///artifact/type.lux_library))) (list\map (..path fs home)))) @@ -156,14 +156,14 @@ (def: .public (host_dependencies fs home) (All [!] (-> (file.System !) Path Resolution (List Path))) (|>> dictionary.keys - (list.only (|>> (get@ #///dependency.type) + (list.only (|>> (value@ #///dependency.type) (text\= ///artifact/type.lux_library) not)) (list\fold (function (_ dependency uniques) - (let [artifact (get@ #///dependency.artifact dependency) - identity [(get@ #///artifact.group artifact) - (get@ #///artifact.name artifact)] - version (get@ #///artifact.version artifact)] + (let [artifact (value@ #///dependency.artifact dependency) + identity [(value@ #///artifact.group artifact) + (value@ #///artifact.name artifact)] + version (value@ #///artifact.version artifact)] (case (dictionary.value identity uniques) (#.Some [current_version current_path]) (if (\ version_order < version current_version) @@ -183,7 +183,7 @@ (def: (plural name) (-> Text (List Text) (List Text)) - (|>> (list\map (|>> (list name))) list.joined)) + (|>> (list\map (|>> (list name))) list.together)) (def: .public start "[BUILD STARTED]") (def: .public success "[BUILD ENDED]") @@ -245,8 +245,7 @@ (-> (List Path) Text) (|> host_dependencies (#.Item ".") - (text.interposed ..jvm_class_path_separator) - %.text)) + (text.interposed ..jvm_class_path_separator))) (def: .public (with_jvm_class_path host_dependencies runtime) (-> (List Path) ///runtime.Runtime ///runtime.Runtime) @@ -255,15 +254,15 @@ runtime _ - (update@ #///runtime.parameters - (|>> (list& "-classpath" (..jvm_class_path host_dependencies))) - runtime))) + (revised@ #///runtime.parameters + (|>> (list& "-cp" (..jvm_class_path host_dependencies))) + runtime))) (def: .public (do! console program fs shell resolution) (-> (Console Async) (Program Async) (file.System Async) (Shell Async) Resolution (Command [Exit Compiler Path])) (function (_ profile) - (let [target (get@ #///.target profile)] - (case (get@ #///.program profile) + (let [target (value@ #///.target profile)] + (case (value@ #///.program profile) #.None (async\in (exception.except ..no_specified_program [])) @@ -273,19 +272,20 @@ .let [home (\ program home) working_directory (\ program directory)]] (do ///action.monad - [[resolution compiler] (async\in (..compiler resolution (get@ #///.compiler profile))) + [[resolution compiler] (async\in (..compiler resolution (value@ #///.compiler profile))) .let [host_dependencies (..host_dependencies fs home resolution) [[command compiler_params] output] (case compiler (#JVM dependency) - [(|> (..path fs home dependency) - (///runtime.for (get@ #///.java profile)) - (with_jvm_class_path host_dependencies)) + [(|> (value@ #///.java profile) + (with@ #///runtime.parameters (list "program._")) + (with_jvm_class_path (#.Item (..path fs home dependency) host_dependencies))) "program.jar"] (^template [<tag> <runtime> <program>] [(<tag> dependency) - [(///runtime.for (get@ <runtime> profile) - (..path fs home dependency)) + [(|> dependency + (..path fs home) + (///runtime.for (value@ <runtime> profile))) <program>]]) ([#JS #///.js "program.js"] [#Python #///.java "program.py"] @@ -294,13 +294,13 @@ / (\ fs separator) cache_directory (format working_directory / target)] _ (console.write_line ..start console) - .let [full_parameters (list.joined (list compiler_params - (list "build") - (..plural "--library" (..libraries fs home resolution)) - (..plural "--host_dependency" host_dependencies) - (..plural "--source" (set.list (get@ #///.sources profile))) - (..singular "--target" cache_directory) - (..singular "--module" program_module)))] + .let [full_parameters (list.together (list compiler_params + (list "build") + (..plural "--library" (..libraries fs home resolution)) + (..plural "--host_dependency" host_dependencies) + (..plural "--source" (set.list (value@ #///.sources profile))) + (..singular "--target" cache_directory) + (..singular "--module" program_module)))] process (\ shell execute [environment working_directory command diff --git a/stdlib/source/program/aedifex/command/clean.lux b/stdlib/source/program/aedifex/command/clean.lux index 67d539db7..9e55ccc83 100644 --- a/stdlib/source/program/aedifex/command/clean.lux +++ b/stdlib/source/program/aedifex/command/clean.lux @@ -33,7 +33,7 @@ (def: .public (do! console fs profile) (-> (Console Async) (file.System Async) (Command Any)) (do {! async.monad} - [.let [target (get@ #///.target profile)] + [.let [target (value@ #///.target profile)] ? (\ fs directory? target) _ (let [! ///action.monad] (if ? diff --git a/stdlib/source/program/aedifex/command/deploy.lux b/stdlib/source/program/aedifex/command/deploy.lux index cbddc9b27..38f975939 100644 --- a/stdlib/source/program/aedifex/command/deploy.lux +++ b/stdlib/source/program/aedifex/command/deploy.lux @@ -60,7 +60,7 @@ (-> (Console Async) (Repository Async) (file.System Async) Artifact (Command Any)) (do {! ///action.monad} [library (|> profile - (get@ #/.sources) + (value@ #/.sources) set.list (export.library fs) (\ ! map (binary.result tar.writer))) diff --git a/stdlib/source/program/aedifex/command/deps.lux b/stdlib/source/program/aedifex/command/deps.lux index 3cbb82403..3c8381e51 100644 --- a/stdlib/source/program/aedifex/command/deps.lux +++ b/stdlib/source/program/aedifex/command/deps.lux @@ -33,16 +33,16 @@ (def: format (%.Format Dependency) - (|>> (get@ #///dependency.artifact) + (|>> (value@ #///dependency.artifact) ///artifact.format %.text)) (def: .public (do! console local remotes new_repository profile) (-> (Console Async) (Repository Async) (List (Repository Async)) (-> URL (Repository Async)) (Command Resolution)) (do async.monad - [.let [dependencies (|> (get@ #///.dependencies profile) + [.let [dependencies (|> (value@ #///.dependencies profile) set.list - (#.Item (get@ #///.compiler profile)))] + (#.Item (value@ #///.compiler profile)))] [local_successes local_failures cache] (///dependency/resolution.all console (list local) new_repository diff --git a/stdlib/source/program/aedifex/command/install.lux b/stdlib/source/program/aedifex/command/install.lux index 9b06daaec..f0677afc7 100644 --- a/stdlib/source/program/aedifex/command/install.lux +++ b/stdlib/source/program/aedifex/command/install.lux @@ -51,11 +51,11 @@ (def: .public (do! console fs repository profile) (-> (Console Async) (file.System Async) (Repository Async) (Command Any)) - (case (get@ #/.identity profile) + (case (value@ #/.identity profile) (#.Some identity) (do ///action.monad [package (|> profile - (get@ #/.sources) + (value@ #/.sources) set.list (export.library fs)) pom (|> profile diff --git a/stdlib/source/program/aedifex/command/test.lux b/stdlib/source/program/aedifex/command/test.lux index a7279c5ec..ae627bcb7 100644 --- a/stdlib/source/program/aedifex/command/test.lux +++ b/stdlib/source/program/aedifex/command/test.lux @@ -36,7 +36,7 @@ (do {! ///action.monad} [.let [home (\ program home)] [build_exit compiler program] (//build.do! console program fs shell resolution - (set@ #///.program (get@ #///.test profile) profile))] + (with@ #///.program (value@ #///.test profile) profile))] (if (i.= shell.normal build_exit) (do ! [_ (console.write_line ..start console) @@ -44,15 +44,14 @@ [test_command test_parameters] (case compiler (#//build.JVM dependency) (|> program - (///runtime.for (get@ #///.java profile)) + (///runtime.for (value@ #///.java profile)) (//build.with_jvm_class_path host_dependencies)) (^template [<tag> <runtime>] [(<tag> artifact) - (///runtime.for (get@ <runtime> profile) + (///runtime.for (value@ <runtime> profile) program)]) - ([#//build.JVM #///.java] - [#//build.JS #///.js] + ([#//build.JS #///.js] [#//build.Python #///.python] [#//build.Lua #///.lua] [#//build.Ruby #///.ruby]))] diff --git a/stdlib/source/program/aedifex/dependency.lux b/stdlib/source/program/aedifex/dependency.lux index f31f0ca44..b1a23c0de 100644 --- a/stdlib/source/program/aedifex/dependency.lux +++ b/stdlib/source/program/aedifex/dependency.lux @@ -35,10 +35,10 @@ ..equivalence) (def: (< reference subject) - (<| (or (//\< (get@ #artifact reference) - (get@ #artifact subject))) + (<| (or (//\< (value@ #artifact reference) + (value@ #artifact subject))) - (and (//\= (get@ #artifact reference) - (get@ #artifact subject))) - (text\< (get@ #type reference) - (get@ #type subject))))) + (and (//\= (value@ #artifact reference) + (value@ #artifact subject))) + (text\< (value@ #type reference) + (value@ #type subject))))) diff --git a/stdlib/source/program/aedifex/dependency/deployment.lux b/stdlib/source/program/aedifex/dependency/deployment.lux index d23e4a805..0e9ab0def 100644 --- a/stdlib/source/program/aedifex/dependency/deployment.lux +++ b/stdlib/source/program/aedifex/dependency/deployment.lux @@ -91,39 +91,39 @@ (do try.monad [now (: (Try ///artifact/time.Time) (///artifact/time.of_instant now)) - .let [version_template (get@ #///artifact.version artifact) + .let [version_template (value@ #///artifact.version artifact) snapshot (|> snapshot - (update@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] - (function (_ snapshot) - (case snapshot - #///artifact/snapshot.Local - #///artifact/snapshot.Local - - (#///artifact/snapshot.Remote [_ build]) - (#///artifact/snapshot.Remote [now (inc build)])))) - (set@ [#///metadata/snapshot.versioning #///artifact/versioning.last_updated] now)) - versioning_snapshot (get@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] snapshot)]] + (revised@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] + (function (_ snapshot) + (case snapshot + #///artifact/snapshot.Local + #///artifact/snapshot.Local + + (#///artifact/snapshot.Remote [_ build]) + (#///artifact/snapshot.Remote [now (++ build)])))) + (with@ [#///metadata/snapshot.versioning #///artifact/versioning.last_updated] now)) + versioning_snapshot (value@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] snapshot)]] (in (|> snapshot - (set@ [#///metadata/snapshot.versioning #///artifact/versioning.versions] - (list {#///artifact/snapshot/version.extension type - #///artifact/snapshot/version.value (///artifact/snapshot/version/value.format - {#///artifact/snapshot/version/value.version version_template - #///artifact/snapshot/version/value.snapshot versioning_snapshot}) - #///artifact/snapshot/version.updated now})) - ... (set@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] - ... (list\compose (..artifacts type (product.right (get@ #///package.library package))) - ... (..artifacts ///artifact/type.pom (product.right (get@ #///package.pom package))))) + (with@ [#///metadata/snapshot.versioning #///artifact/versioning.versions] + (list {#///artifact/snapshot/version.extension type + #///artifact/snapshot/version.value (///artifact/snapshot/version/value.format + {#///artifact/snapshot/version/value.version version_template + #///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))))) )))) (def: .public (one repository [artifact type] package) (-> (Repository Async) Dependency Package (Async (Try Artifact))) (do {! async.monad} [now (async.future instant.now) - .let [version_template (get@ #///artifact.version artifact)]] + .let [version_template (value@ #///artifact.version artifact)]] (do (try.with !) - [_ (with_status repository version_template [artifact type] (get@ #///package.library package)) + [_ (with_status repository version_template [artifact type] (value@ #///package.library package)) - _ (let [[pom pom_data status] (get@ #///package.pom package)] + _ (let [[pom pom_data status] (value@ #///package.pom package)] (with_status repository version_template [artifact ///artifact/type.pom] @@ -135,8 +135,8 @@ _ (///metadata/snapshot.write repository artifact snapshot) project (///metadata/artifact.read repository artifact) _ (|> project - (set@ #///metadata/artifact.versions (list version_template)) - (set@ #///metadata/artifact.last_updated now) + (with@ #///metadata/artifact.versions (list version_template)) + (with@ #///metadata/artifact.last_updated now) (///metadata/artifact.write repository artifact))] (in artifact)))) diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux index 22778e25b..73c5f6608 100644 --- a/stdlib/source/program/aedifex/dependency/resolution.lux +++ b/stdlib/source/program/aedifex/dependency/resolution.lux @@ -1,6 +1,7 @@ (.module: [library [lux (#- Name) + ["@" target] ["." debug] ["." ffi (#+ import:)] [abstract @@ -83,9 +84,10 @@ (case ?actual (#try.Success actual) (in (do {! try.monad} - [output (\ ! map (|>> (:as java/lang/String) - java/lang/String::trim - (:as Text)) + [output (\ ! map (for {@.old (|>> (:as java/lang/String) + java/lang/String::trim + (:as Text)) + @.jvm (|>> java/lang/String::trim)}) (\ utf8.codec decode actual)) actual (|> output (text.all_split_by " ") @@ -113,10 +115,10 @@ [(#.Some sha-1) (#.Some md5)] (#//status.Verified sha-1 md5) - [(#.Some sha-1) _] + [(#.Some sha-1) #.None] (#//status.Partial (#.Left sha-1)) - [_ (#.Some md5)] + [#.None (#.Some md5)] (#//status.Partial (#.Right md5)) [#.None #.None] @@ -128,10 +130,10 @@ extension (///artifact/extension.extension type)] (do (try.with async.monad) [snapshot (///metadata/snapshot.read repository artifact) - .let [version_template (get@ [#///metadata/snapshot.artifact #///artifact.version] snapshot) + .let [version_template (value@ [#///metadata/snapshot.artifact #///artifact.version] snapshot) artifact_version (value.format {#value.version version_template - #value.snapshot (get@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] snapshot)}) - artifact (set@ #///artifact.version artifact_version artifact)] + #value.snapshot (value@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] snapshot)}) + artifact (with@ #///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)] (\ async.monad in @@ -156,8 +158,8 @@ (exception: .public (cannot_resolve {dependency Dependency}) (exception.report - ["Artifact" (%.text (///artifact.format (get@ #//.artifact dependency)))] - ["Type" (%.text (get@ #//.type dependency))])) + ["Artifact" (%.text (///artifact.format (value@ #//.artifact dependency)))] + ["Type" (%.text (value@ #//.type dependency))])) (template [<sigil> <name> <doing> <at>] [(def: (<name> console repository artifact) @@ -184,17 +186,17 @@ (#.Item repository alternatives) (do {! async.monad} - [_ (..announce_fetching console repository (get@ #//.artifact dependency)) + [_ (..announce_fetching console repository (value@ #//.artifact dependency)) outcome (..one repository dependency)] (case outcome (#try.Success package) (do ! - [_ (..announce_success console repository (get@ #//.artifact dependency))] + [_ (..announce_success console repository (value@ #//.artifact dependency))] (in outcome)) (#try.Failure error) (do ! - [_ (..announce_failure console repository (get@ #//.artifact dependency))] + [_ (..announce_failure console repository (value@ #//.artifact dependency))] (any console alternatives dependency)))))) (def: .public (all console repositories new_repository dependencies resolution) @@ -213,7 +215,7 @@ [successes failures resolution]) (#.Item head tail) - (case (get@ [#//.artifact #///artifact.version] head) + (case (value@ [#//.artifact #///artifact.version] head) ... Skip if there is no version "" (recur repositories successes diff --git a/stdlib/source/program/aedifex/format.lux b/stdlib/source/program/aedifex/format.lux index 82b15f84d..74583c8f5 100644 --- a/stdlib/source/program/aedifex/format.lux +++ b/stdlib/source/program/aedifex/format.lux @@ -108,13 +108,13 @@ (def: (info value) (Format /.Info) (|> ..empty - (..on_maybe "url" (get@ #/.url value) code.text) - (..on_maybe "scm" (get@ #/.scm value) code.text) - (..on_maybe "description" (get@ #/.description value) code.text) - (..on_list "licenses" (get@ #/.licenses value) ..license) - (..on_maybe "organization" (get@ #/.organization value) ..organization) - (..on_list "developers" (get@ #/.developers value) ..developer) - (..on_list "contributors" (get@ #/.contributors value) ..contributor) + (..on_maybe "url" (value@ #/.url value) code.text) + (..on_maybe "scm" (value@ #/.scm value) code.text) + (..on_maybe "description" (value@ #/.description value) code.text) + (..on_list "licenses" (value@ #/.licenses value) ..license) + (..on_maybe "organization" (value@ #/.organization value) ..organization) + (..on_list "developers" (value@ #/.developers value) ..developer) + (..on_list "contributors" (value@ #/.contributors value) ..contributor) ..aggregate)) (def: (artifact' [group name version]) @@ -142,19 +142,19 @@ (def: .public (profile value) (Format /.Profile) (`` (|> ..empty - (..on_list "parents" (get@ #/.parents value) code.text) - (..on_maybe "identity" (get@ #/.identity value) ..artifact) - (..on_maybe "info" (get@ #/.info value) ..info) - (..on_set "repositories" (get@ #/.repositories value) code.text) - (..on_set "dependencies" (get@ #/.dependencies value) ..dependency) - (dictionary.has "compiler" (..dependency (get@ #/.compiler value))) - (..on_set "sources" (get@ #/.sources value) code.text) - (dictionary.has "target" (code.text (get@ #/.target value))) - (..on_maybe "program" (get@ #/.program value) code.text) - (..on_maybe "test" (get@ #/.test value) code.text) - (..on_dictionary "deploy_repositories" (get@ #/.deploy_repositories value) code.text code.text) + (..on_list "parents" (value@ #/.parents value) code.text) + (..on_maybe "identity" (value@ #/.identity value) ..artifact) + (..on_maybe "info" (value@ #/.info value) ..info) + (..on_set "repositories" (value@ #/.repositories value) code.text) + (..on_set "dependencies" (value@ #/.dependencies value) ..dependency) + (dictionary.has "compiler" (..dependency (value@ #/.compiler value))) + (..on_set "sources" (value@ #/.sources value) code.text) + (dictionary.has "target" (code.text (value@ #/.target value))) + (..on_maybe "program" (value@ #/.program value) code.text) + (..on_maybe "test" (value@ #/.test value) code.text) + (..on_dictionary "deploy_repositories" (value@ #/.deploy_repositories value) code.text code.text) (~~ (template [<tag>] - [(dictionary.has (template.text [<tag>]) (..runtime (get@ <tag> value)))] + [(dictionary.has (template.text [<tag>]) (..runtime (value@ <tag> value)))] [#/.java] [#/.js] diff --git a/stdlib/source/program/aedifex/hash.lux b/stdlib/source/program/aedifex/hash.lux index 63394c8c9..92414c441 100644 --- a/stdlib/source/program/aedifex/hash.lux +++ b/stdlib/source/program/aedifex/hash.lux @@ -31,10 +31,12 @@ (#static getInstance [java/lang/String] java/security/MessageDigest) (digest [[byte]] [byte])]) -(abstract: .public SHA-1 Any) -(abstract: .public MD5 Any) +(abstract: .public SHA-1 {} Any) +(abstract: .public MD5 {} Any) (abstract: .public (Hash h) + {} + Binary (def: .public data @@ -54,13 +56,13 @@ (def: encode (Format Binary) - (binary.fold (function (_ byte representation) - (let [hex (\ n.hex encode byte) - hex (case (text.size hex) - 1 (format "0" hex) - _ hex)] - (format representation hex))) - "")) + (binary.aggregate (function (_ byte representation) + (let [hex (\ n.hex encode byte) + hex (case (text.size hex) + 1 (format "0" hex) + _ hex)] + (format representation hex))) + "")) (template [<factor> <name>] [(def: <name> @@ -128,7 +130,7 @@ (do try.monad [head (\ n.hex decode head) output (binary.write/64! index head output)] - (recur tail (inc chunk) output)) + (recur tail (++ chunk) output)) #.None (case (..hash_size input) diff --git a/stdlib/source/program/aedifex/metadata.lux b/stdlib/source/program/aedifex/metadata.lux index 5badc4783..c8bad9fed 100644 --- a/stdlib/source/program/aedifex/metadata.lux +++ b/stdlib/source/program/aedifex/metadata.lux @@ -18,16 +18,16 @@ (def: .public (remote_artifact_uri artifact) (-> Artifact URI) (let [/ uri.separator] - (format (//artifact.directory / (get@ #//artifact.group artifact)) - / (get@ #//artifact.name artifact) - / (get@ #//artifact.version artifact) + (format (//artifact.directory / (value@ #//artifact.group artifact)) + / (value@ #//artifact.name artifact) + / (value@ #//artifact.version artifact) / ..remote_file))) (def: .public (remote_project_uri artifact) (-> Artifact URI) (let [/ uri.separator] - (format (//artifact.directory / (get@ #//artifact.group artifact)) - / (get@ #//artifact.name artifact) + (format (//artifact.directory / (value@ #//artifact.group artifact)) + / (value@ #//artifact.name artifact) / ..remote_file))) (def: local_file diff --git a/stdlib/source/program/aedifex/metadata/artifact.lux b/stdlib/source/program/aedifex/metadata/artifact.lux index 0d6f86c2c..3512114be 100644 --- a/stdlib/source/program/aedifex/metadata/artifact.lux +++ b/stdlib/source/program/aedifex/metadata/artifact.lux @@ -99,12 +99,12 @@ (-> Metadata XML) (#xml.Node ..<metadata> xml.attributes - (list (..group_format (get@ #group value)) - (..name_format (get@ #name value)) + (list (..group_format (value@ #group value)) + (..name_format (value@ #name value)) (#xml.Node ..<versioning> xml.attributes - (list (..versions_format (get@ #versions value)) - (..last_updated_format (get@ #last_updated value))))))) + (list (..versions_format (value@ #versions value)) + (..last_updated_format (value@ #last_updated value))))))) (def: (text tag) (-> xml.Tag (Parser Text)) diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux index 90fa9bb86..6a32effef 100644 --- a/stdlib/source/program/aedifex/metadata/snapshot.lux +++ b/stdlib/source/program/aedifex/metadata/snapshot.lux @@ -95,14 +95,14 @@ #///artifact/snapshot/version.updated ///artifact/time.epoch}] (|> (<xml>.somewhere ///artifact/versioning.parser) (\ ! map - (update@ #///artifact/versioning.versions - (: (-> (List ///artifact/snapshot/version.Version) - (List ///artifact/snapshot/version.Version)) - (|>> (case> (^ (list)) - (list <default_version>) + (revised@ #///artifact/versioning.versions + (: (-> (List ///artifact/snapshot/version.Version) + (List ///artifact/snapshot/version.Version)) + (|>> (case> (^ (list)) + (list <default_version>) - versions - versions))))) + versions + versions))))) (<>.else {#///artifact/versioning.snapshot #///artifact/snapshot.Local #///artifact/versioning.last_updated ///artifact/time.epoch #///artifact/versioning.versions (list <default_version>)})))] diff --git a/stdlib/source/program/aedifex/package.lux b/stdlib/source/program/aedifex/package.lux index 6b65a936d..c0c73e0fd 100644 --- a/stdlib/source/program/aedifex/package.lux +++ b/stdlib/source/program/aedifex/package.lux @@ -1,6 +1,6 @@ (.module: [library - [lux #* + [lux (#- local) [abstract [equivalence (#+ Equivalence)]] [control @@ -36,7 +36,7 @@ (template [<name> <tag>] [(def: .public (<name> package) (-> Package Bit) - (case (get@ #origin package) + (case (value@ #origin package) (<tag> _) true @@ -61,19 +61,19 @@ (def: .public dependencies (-> Package (Try (Set Dependency))) - (|>> (get@ #pom) + (|>> (value@ #pom) product.left list (<xml>.result //pom.parser) - (try\map (get@ #/.dependencies)))) + (try\map (value@ #/.dependencies)))) (def: .public repositories (-> Package (Try (Set Address))) - (|>> (get@ #pom) + (|>> (value@ #pom) product.left list (<xml>.result //pom.parser) - (try\map (get@ #/.repositories)))) + (try\map (value@ #/.repositories)))) (def: .public equivalence (Equivalence Package) diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux index 6d4d05b92..d5f4d3bb8 100644 --- a/stdlib/source/program/aedifex/parser.lux +++ b/stdlib/source/program/aedifex/parser.lux @@ -262,7 +262,7 @@ (Parser Project) (let [default_profile (: (Parser Project) (\ <>.monad map - (|>> [/.else] (list) (dictionary.of_list text.hash)) + (|>> [/.default] (list) (dictionary.of_list text.hash)) ..profile)) multi_profile (: (Parser Project) (\ <>.monad map diff --git a/stdlib/source/program/aedifex/pom.lux b/stdlib/source/program/aedifex/pom.lux index 36e3ff440..810c30588 100644 --- a/stdlib/source/program/aedifex/pom.lux +++ b/stdlib/source/program/aedifex/pom.lux @@ -58,9 +58,9 @@ (def: (artifact value) (-> Artifact (List XML)) - (list (..property ..group_tag (get@ #//artifact.group value)) - (..property ..artifact_tag (get@ #//artifact.name value)) - (..property ..version_tag (get@ #//artifact.version value)))) + (list (..property ..group_tag (value@ #//artifact.group value)) + (..property ..artifact_tag (value@ #//artifact.name value)) + (..property ..version_tag (value@ #//artifact.version value)))) (def: distribution (-> /.Distribution XML) @@ -85,8 +85,8 @@ (-> Dependency XML) (#_.Node ["" ..dependency_tag] _.attributes - (list\compose (..artifact (get@ #//dependency.artifact value)) - (list (..property "type" (get@ #//dependency.type value)))))) + (list\compose (..artifact (value@ #//dependency.artifact value)) + (list (..property "type" (value@ #//dependency.type value)))))) (def: (group tag) (-> Text (-> (List XML) XML)) @@ -128,27 +128,27 @@ (def: (info value) (-> /.Info (List XML)) ($_ list\compose - (|> value (get@ #/.url) (maybe\map (..property ..url_tag)) maybe.list) - (|> value (get@ #/.description) (maybe\map (..property "description")) maybe.list) - (|> value (get@ #/.licenses) (list\map ..license) (..group "licenses") list) - (|> value (get@ #/.scm) (maybe\map ..scm) maybe.list) - (|> value (get@ #/.organization) (maybe\map ..organization) maybe.list) - (|> value (get@ #/.developers) (list\map ..developer) (..group "developers") list) - (|> value (get@ #/.contributors) (list\map ..contributor) (..group "contributors") list) + (|> 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) )) ) (def: .public (write value) (-> /.Profile (Try XML)) - (case (get@ #/.identity value) + (case (value@ #/.identity value) (#.Some identity) (#try.Success (#_.Node ["" ..project_tag] _.attributes ($_ list\compose (list ..version) (..artifact identity) - (|> value (get@ #/.repositories) set.list (list\map ..repository) (..group "repositories") list) - (|> value (get@ #/.dependencies) set.list (list\map ..dependency) (..group ..dependencies_tag) list) + (|> value (value@ #/.repositories) set.list (list\map ..repository) (..group "repositories") list) + (|> value (value@ #/.dependencies) set.list (list\map ..dependency) (..group ..dependencies_tag) list) ))) _ @@ -225,7 +225,7 @@ (<>.else (list))) _ (<>.some <xml>.any)] (in (|> (\ /.monoid identity) - (update@ #/.dependencies (function (_ empty) - (list\fold set.has empty dependencies))) - (update@ #/.repositories (function (_ empty) - (list\fold set.has empty repositories))))))))) + (revised@ #/.dependencies (function (_ empty) + (list\fold set.has empty dependencies))) + (revised@ #/.repositories (function (_ empty) + (list\fold set.has empty repositories))))))))) diff --git a/stdlib/source/program/aedifex/profile.lux b/stdlib/source/program/aedifex/profile.lux index 2ff458967..f4a1f9a0d 100644 --- a/stdlib/source/program/aedifex/profile.lux +++ b/stdlib/source/program/aedifex/profile.lux @@ -230,24 +230,24 @@ (def: (compose override baseline) (template.let [(!runtime <tag> <runtime>) - [(if (runtime\= <runtime> (get@ <tag> override)) - (get@ <tag> baseline) - (get@ <tag> override))]] - {#parents (list\compose (get@ #parents baseline) (get@ #parents override)) - #identity (maybe\compose (get@ #identity override) (get@ #identity baseline)) - #info (maybe\compose (get@ #info override) (get@ #info baseline)) - #repositories (set.union (get@ #repositories baseline) (get@ #repositories override)) - #dependencies (set.union (get@ #dependencies baseline) (get@ #dependencies override)) - #compiler (if (dependency\= ..default_compiler (get@ #compiler override)) - (get@ #compiler baseline) - (get@ #compiler override)) - #sources (set.union (get@ #sources baseline) (get@ #sources override)) - #target (if (text\= ..default_target (get@ #target baseline)) - (get@ #target override) - (get@ #target baseline)) - #program (maybe\compose (get@ #program override) (get@ #program baseline)) - #test (maybe\compose (get@ #test override) (get@ #test baseline)) - #deploy_repositories (dictionary.merged (get@ #deploy_repositories override) (get@ #deploy_repositories baseline)) + [(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)) + #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)) + (value@ #compiler baseline) + (value@ #compiler override)) + #sources (set.union (value@ #sources baseline) (value@ #sources override)) + #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)) + #deploy_repositories (dictionary.merged (value@ #deploy_repositories override) (value@ #deploy_repositories baseline)) #java (!runtime #java runtime.default_java) #js (!runtime #js runtime.default_js) #python (!runtime #python runtime.default_python) diff --git a/stdlib/source/program/aedifex/project.lux b/stdlib/source/program/aedifex/project.lux index 951e82d34..5717221d1 100644 --- a/stdlib/source/program/aedifex/project.lux +++ b/stdlib/source/program/aedifex/project.lux @@ -55,17 +55,17 @@ (case (dictionary.value name project) (#.Some profile) (case (list.example (set.member? lineage) - (get@ #//.parents profile)) + (value@ #//.parents profile)) (#.Some ouroboros) (exception.except ..circular_dependency [ouroboros name]) #.None (do {! try.monad} [parents (monad.map ! (profile' (set.has name lineage) project) - (get@ #//.parents profile))] + (value@ #//.parents profile))] (in (list\fold (function (_ parent child) (\ //.monoid compose child parent)) - (set@ #//.parents (list) profile) + (with@ #//.parents (list) profile) parents)))) #.None diff --git a/stdlib/source/program/aedifex/repository/remote.lux b/stdlib/source/program/aedifex/repository/remote.lux index feaf3201f..11d29716e 100644 --- a/stdlib/source/program/aedifex/repository/remote.lux +++ b/stdlib/source/program/aedifex/repository/remote.lux @@ -68,11 +68,11 @@ http))] (case status (^ (static http/status.ok)) - (\ ! map product.right ((get@ #@http.body message) #.None)) + (\ ! map product.right ((value@ #@http.body message) #.None)) _ (do ! - [_ ((get@ #@http.body message) (#.Some 0))] + [_ ((value@ #@http.body message) (#.Some 0))] (\ io.monad in (exception.except ..download_failure [(format address uri) status])))))) (def: (upload uri content) @@ -88,7 +88,7 @@ ..base_headers))) (#.Some content) http)) - _ ((get@ #@http.body message) (#.Some 0))] + _ ((value@ #@http.body message) (#.Some 0))] (case status (^ (static http/status.created)) (in []) diff --git a/stdlib/source/program/aedifex/runtime.lux b/stdlib/source/program/aedifex/runtime.lux index b239d03ea..f029bed15 100644 --- a/stdlib/source/program/aedifex/runtime.lux +++ b/stdlib/source/program/aedifex/runtime.lux @@ -40,7 +40,7 @@ (def: .public (for runtime path) (-> Runtime file.Path Runtime) - (update@ #parameters - (function (_ parameters) - (list\compose parameters (list path))) - runtime)) + (revised@ #parameters + (function (_ parameters) + (list\compose parameters (list path))) + runtime)) |