From 2b909032e7a0bd10cd7db52067d2fb701bfa95e5 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 6 Jul 2021 21:34:21 -0400 Subject: Simplified the API for file-system operations. --- stdlib/source/program/aedifex/repository.lux | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'stdlib/source/program/aedifex/repository.lux') 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} -- cgit v1.2.3