diff options
author | Eduardo Julian | 2020-12-25 09:22:38 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-25 09:22:38 -0400 |
commit | 4ca397765805eda5ddee393901ed3a02001a960a (patch) | |
tree | 2ab184a1a4e244f3a69e86c8a7bb3ad49c22b4a3 /stdlib/source/program/aedifex/cache.lux | |
parent | d29e091e98dabb8dfcf816899ada480ecbf7e357 (diff) |
Replaced kebab-case with snake_case for naming convention.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/cache.lux | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/stdlib/source/program/aedifex/cache.lux b/stdlib/source/program/aedifex/cache.lux index ce95f65b7..d36bb8dff 100644 --- a/stdlib/source/program/aedifex/cache.lux +++ b/stdlib/source/program/aedifex/cache.lux @@ -39,10 +39,10 @@ (-> (file.System Promise) Binary Path (Promise (Try Any))) (do (try.with promise.monad) [file (: (Promise (Try (File Promise))) - (file.get-file promise.monad system file))] - (!.use (\ file over-write) [content]))) + (file.get_file promise.monad system file))] + (!.use (\ file over_write) [content]))) -(def: (write-hashed system directory [artifact type] [data status]) +(def: (write_hashed system directory [artifact type] [data status]) (-> (file.System Promise) Path Dependency [Binary Status] (Promise (Try Any))) (let [prefix (format directory (\ system separator) @@ -50,7 +50,7 @@ (//artifact/extension.extension type))] (do {! (try.with promise.monad)} [_ (..write! system data prefix) - #let [write-hash (: (All [h] (-> (Codec Text (Hash h)) Extension (Hash h) (Promise (Try Any)))) + #let [write_hash (: (All [h] (-> (Codec Text (Hash h)) Extension (Hash h) (Promise (Try Any)))) (function (_ codec extension hash) (..write! system (|> hash (\ codec encode) (\ encoding.utf8 encode)) @@ -62,40 +62,40 @@ (#//dependency/status.Partial partial) (case partial (#.Left sha-1) - (write-hash //hash.sha-1-codec //artifact/extension.sha-1 sha-1) + (write_hash //hash.sha-1_codec //artifact/extension.sha-1 sha-1) (#.Right md5) - (write-hash //hash.md5-codec //artifact/extension.md5 md5)) + (write_hash //hash.md5_codec //artifact/extension.md5 md5)) (#//dependency/status.Verified sha-1 md5) (do ! - [_ (write-hash //hash.sha-1-codec //artifact/extension.sha-1 sha-1)] - (write-hash //hash.md5-codec //artifact/extension.md5 md5)))))) + [_ (write_hash //hash.sha-1_codec //artifact/extension.sha-1 sha-1)] + (write_hash //hash.md5_codec //artifact/extension.md5 md5)))))) -(def: #export (write-one program system [artifact type] package) +(def: #export (write_one program system [artifact type] package) (-> (Program Promise) (file.System Promise) Dependency Package (Promise (Try Artifact))) (do promise.monad [home (\ program home [])] (do (try.with promise.monad) [directory (: (Promise (Try Path)) - (file.make-directories promise.monad system (//.path system home artifact))) - _ (write-hashed system directory [artifact type] (get@ #//package.library package)) + (file.make_directories promise.monad system (//.path system home artifact))) + _ (write_hashed system directory [artifact type] (get@ #//package.library package)) _ (let [[pom status] (get@ #//package.pom package)] - (write-hashed system directory + (write_hashed system directory [artifact //artifact/type.pom] [(|> pom (\ xml.codec encode) (\ encoding.utf8 encode)) status]))] (wrap artifact)))) -(def: #export (write-all program system resolution) +(def: #export (write_all program system resolution) (-> (Program Promise) (file.System Promise) Resolution (Promise (Try (Set Artifact)))) (do {! (try.with promise.monad)} [] (|> (dictionary.entries resolution) (list.filter (|>> product.right //package.local? not)) (monad.map ! (function (_ [dependency package]) - (..write-one program system dependency package))) - (\ ! map (set.from-list //artifact.hash))))) + (..write_one program system dependency package))) + (\ ! map (set.from_list //artifact.hash))))) (def: (read! system path) (-> (file.System Promise) Path (Promise (Try Binary))) @@ -112,7 +112,7 @@ (_\map (\ codec decode)) _\join))) -(def: #export (read-one program system [artifact type]) +(def: #export (read_one program system [artifact type]) (-> (Program Promise) (file.System Promise) Dependency (Promise (Try Package))) (do promise.monad [home (\ program home []) @@ -123,18 +123,18 @@ [pom (..read! system (format prefix //artifact/extension.pom)) #let [extension (//artifact/extension.extension type)] library (..read! system (format prefix extension)) - library-sha-1 (..read! system (format prefix extension //artifact/extension.sha-1)) - library-md5 (..read! system (format prefix extension //artifact/extension.md5))] + library_sha-1 (..read! system (format prefix extension //artifact/extension.sha-1)) + library_md5 (..read! system (format prefix extension //artifact/extension.md5))] (\ promise.monad wrap (do try.monad [pom (..decode xml.codec pom) - library-sha-1 (..decode //hash.sha-1-codec library-sha-1) - library-md5 (..decode //hash.md5-codec library-md5)] + library_sha-1 (..decode //hash.sha-1_codec library_sha-1) + library_md5 (..decode //hash.md5_codec library_md5)] (wrap {#//package.origin #//package.Local - #//package.library [library (#//dependency/status.Verified library-sha-1 library-md5)] + #//package.library [library (#//dependency/status.Verified library_sha-1 library_md5)] #//package.pom [pom #//dependency/status.Unverified]})))))) -(def: #export (read-all program system dependencies resolution) +(def: #export (read_all program system dependencies resolution) (-> (Program Promise) (file.System Promise) (List Dependency) Resolution (Promise (Try Resolution))) (case dependencies #.Nil @@ -147,17 +147,17 @@ (wrap (#try.Success package)) #.None - (..read-one program system head))] - (with-expansions [<next> (as-is (read-all program system tail resolution))] + (..read_one program system head))] + (with_expansions [<next> (as_is (read_all program system tail resolution))] (case package (#try.Success package) (do (try.with promise.monad) - [sub-dependencies (|> package + [sub_dependencies (|> package //package.dependencies (\ promise.monad wrap)) resolution (|> resolution (dictionary.put head package) - (read-all program system (set.to-list sub-dependencies)))] + (read_all program system (set.to_list sub_dependencies)))] <next>) (#try.Failure error) |