diff options
author | Eduardo Julian | 2021-07-06 21:34:21 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-07-06 21:34:21 -0400 |
commit | 2b909032e7a0bd10cd7db52067d2fb701bfa95e5 (patch) | |
tree | 0e2aaef228f80f3336715327f7f34065c309de22 /stdlib/source/program/aedifex/repository.lux | |
parent | 5cf4efa861075f8276f43a2516f5beacaf610b44 (diff) |
Simplified the API for file-system operations.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/repository.lux | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/stdlib/source/program/aedifex/repository.lux b/stdlib/source/program/aedifex/repository.lux index d966c7f82..05560c6c9 100644 --- a/stdlib/source/program/aedifex/repository.lux +++ b/stdlib/source/program/aedifex/repository.lux @@ -15,6 +15,8 @@ [uri (#+ URI)]]]]) (interface: #export (Repository !) + (: Text + description) (: (-> URI (! (Try Binary))) download) (: (-> URI Binary (! (Try Any))) @@ -23,6 +25,8 @@ (def: #export (async repository) (-> (Repository IO) (Repository Promise)) (implementation + (def: description + (\ repository description)) (def: (download uri) (promise.future (\ repository download uri))) @@ -31,6 +35,8 @@ )) (interface: #export (Mock s) + (: Text + the_description) (: (-> URI s (Try [s Binary])) on_download) (: (-> URI Binary s (Try s)) @@ -40,6 +46,8 @@ (All [s] (-> (Mock s) s (Repository Promise))) (let [state (stm.var init)] (implementation + (def: description + (\ mock the_description)) (def: (download uri) (stm.commit (do {! stm.monad} |