aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/repository
diff options
context:
space:
mode:
authorEduardo Julian2022-12-02 19:33:00 -0400
committerEduardo Julian2022-12-02 19:33:00 -0400
commit94e5802f594a73245fce0fbd885103b8bf210d57 (patch)
tree65e5799c0be40f5f015b39bfa6c87c9c27fd9424 /stdlib/source/program/aedifex/repository
parentb491dfff00219d5206075ea65468e00ab657075d (diff)
Added some simple time-series handling machinery.
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/aedifex/repository.lux12
-rw-r--r--stdlib/source/program/aedifex/repository/identity.lux2
-rw-r--r--stdlib/source/program/aedifex/repository/local.lux12
-rw-r--r--stdlib/source/program/aedifex/repository/remote.lux6
4 files changed, 16 insertions, 16 deletions
diff --git a/stdlib/source/program/aedifex/repository.lux b/stdlib/source/program/aedifex/repository.lux
index ea0507bcf..42053974e 100644
--- a/stdlib/source/program/aedifex/repository.lux
+++ b/stdlib/source/program/aedifex/repository.lux
@@ -28,12 +28,12 @@
(-> (Repository IO) (Repository Async))
(implementation
(def description
- (at repository description))
+ (of repository description))
(def (download uri)
- (async.future (at repository download uri)))
+ (async.future (of repository download uri)))
(def (upload uri content)
- (async.future (at repository upload uri content)))
+ (async.future (of repository upload uri content)))
))
(type .public (Mock s)
@@ -50,13 +50,13 @@
(let [state (stm.var init)]
(implementation
(def description
- (at mock the_description))
+ (of mock the_description))
(def (download uri)
(stm.commit!
(do [! stm.monad]
[|state| (stm.read state)]
- (when (at mock on_download uri |state|)
+ (when (of mock on_download uri |state|)
{try.#Success [|state| output]}
(do !
[_ (stm.write |state| state)]
@@ -69,7 +69,7 @@
(stm.commit!
(do [! stm.monad]
[|state| (stm.read state)]
- (when (at mock on_upload uri content |state|)
+ (when (of mock on_upload uri content |state|)
{try.#Success |state|}
(do !
[_ (stm.write |state| state)]
diff --git a/stdlib/source/program/aedifex/repository/identity.lux b/stdlib/source/program/aedifex/repository/identity.lux
index eaca93cdb..30814ecee 100644
--- a/stdlib/source/program/aedifex/repository/identity.lux
+++ b/stdlib/source/program/aedifex/repository/identity.lux
@@ -39,7 +39,7 @@
(def .public (basic_auth user password)
(-> User Password Text)
- (let [credentials (at utf8.codec encoded (format user ":" password))]
+ (let [credentials (of utf8.codec encoded (format user ":" password))]
(|> (java/util/Base64::getEncoder)
(java/util/Base64$Encoder::encodeToString credentials)
ffi.of_string
diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux
index dcc604306..4223ddf39 100644
--- a/stdlib/source/program/aedifex/repository/local.lux
+++ b/stdlib/source/program/aedifex/repository/local.lux
@@ -22,10 +22,10 @@
(def .public (root environment fs)
(-> (Environment Async) (file.System Async) file.Path)
- (let [/ (at fs separator)]
+ (let [/ (of fs separator)]
(|> ///local.repository
(text.replaced uri.separator /)
- (format (at environment home) /))))
+ (format (of environment home) /))))
(def (path /)
(-> Text (-> URI file.Path))
@@ -33,7 +33,7 @@
(def (absolute_path environment fs)
(-> (Environment Async) (file.System Async) (-> URI file.Path))
- (let [/ (at fs separator)]
+ (let [/ (of fs separator)]
(|>> ///metadata.local_uri
(..path /)
(format (..root environment fs) /))))
@@ -46,12 +46,12 @@
(def download
(|>> (..absolute_path environment fs)
- (at fs read)))
+ (of fs read)))
(def (upload uri content)
(do [! async.monad]
[.let [absolute_path (..absolute_path environment fs uri)]
- ? (at fs file? absolute_path)
+ ? (of fs file? absolute_path)
_ (is (Async (Try Any))
(if ?
(in {try.#Success []})
@@ -61,4 +61,4 @@
_
(in {try.#Success []}))))]
- (at fs write absolute_path content)))))
+ (of fs write absolute_path content)))))
diff --git a/stdlib/source/program/aedifex/repository/remote.lux b/stdlib/source/program/aedifex/repository/remote.lux
index 34488b544..9386c214f 100644
--- a/stdlib/source/program/aedifex/repository/remote.lux
+++ b/stdlib/source/program/aedifex/repository/remote.lux
@@ -69,12 +69,12 @@
http))]
(when status
http/status.ok
- (at ! each product.right ((the @http.#body message) {.#None}))
+ (of ! each product.right ((the @http.#body message) {.#None}))
_
(do !
[_ ((the @http.#body message) {.#Some 0})]
- (at io.monad in (exception.except ..download_failure [(format address uri) status]))))))
+ (of io.monad in (exception.except ..download_failure [(format address uri) status]))))))
(def (upload uri content)
(do (try.with io.monad)
@@ -95,5 +95,5 @@
(in [])
_
- (at io.monad in (exception.except ..upload_failure [(format address uri) status])))))
+ (of io.monad in (exception.except ..upload_failure [(format address uri) status])))))
))