aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command/auto.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-06-24 03:42:57 -0400
committerEduardo Julian2021-06-24 03:42:57 -0400
commitce1a7a131f7c4df8eae5c019eba2893b56f04d46 (patch)
tree645c4b42c4b9bff141b7390d9f33f3f1fe4aeea1 /stdlib/source/program/aedifex/command/auto.lux
parenta82bd1eabe94763162c2b0707d9c198fbe9835e3 (diff)
Added a macro for type-casting JVM objects.
Diffstat (limited to 'stdlib/source/program/aedifex/command/auto.lux')
-rw-r--r--stdlib/source/program/aedifex/command/auto.lux16
1 files changed, 10 insertions, 6 deletions
diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux
index afce4d6ff..000384ccd 100644
--- a/stdlib/source/program/aedifex/command/auto.lux
+++ b/stdlib/source/program/aedifex/command/auto.lux
@@ -42,13 +42,17 @@
(#try.Failure error)
(wrap (list)))))
-(def: (pause _)
- (-> Any (Promise (Try Any)))
- (promise.delay 1,000 (#try.Success [])))
+(def: #export delay
+ Nat
+ 1,000)
-(def: #export (do! watcher command)
+(def: (pause delay)
+ (-> Nat (Promise (Try Any)))
+ (promise.delay delay (#try.Success [])))
+
+(def: #export (do! delay watcher command)
(All [a]
- (-> (Watcher Promise)
+ (-> Nat (Watcher Promise)
(-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command a))
(-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command Any))))
(function (_ console program fs shell resolution)
@@ -65,7 +69,7 @@
_ <call>]
(loop [_ []]
(do !
- [_ (..pause [])
+ [_ (..pause delay)
events (\ watcher poll [])
_ (case events
(#.Cons _)