aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command/auto.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-11-27 00:07:51 -0400
committerEduardo Julian2020-11-27 00:07:51 -0400
commit889139602b77e4387a6e8bfbedacc2a08703e976 (patch)
tree3a113e298037122e81b5529475bd1e59286f733f /stdlib/source/program/aedifex/command/auto.lux
parentdbb658bd7976c073a2bf314f194b36b30c45784b (diff)
Re-named lux/data/format/context to lux/control/parser/environment.
Diffstat (limited to 'stdlib/source/program/aedifex/command/auto.lux')
-rw-r--r--stdlib/source/program/aedifex/command/auto.lux23
1 files changed, 14 insertions, 9 deletions
diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux
index 0fc223376..80ff8ac8c 100644
--- a/stdlib/source/program/aedifex/command/auto.lux
+++ b/stdlib/source/program/aedifex/command/auto.lux
@@ -7,19 +7,21 @@
["." try (#+ Try)]
["." io (#+ IO)]
[concurrency
- ["." promise]]]
+ ["." promise (#+ Promise)]]]
[data
[collection
["." array]
["." list]
["." set]]]
[world
- [file (#+ Path)]]]
+ ["." file (#+ Path)]]]
["." // #_
["/#" // #_
["#" profile]
["#." action (#+ Action)]
- ["#." command (#+ Command)]]])
+ ["#." command (#+ Command)]
+ [dependency
+ [resolution (#+ Resolution)]]]])
(import: java/nio/file/WatchKey
["#::."
@@ -124,18 +126,21 @@
#.None
(wrap []))))
-(def: #export (do! command profile)
- (All [a] (-> (Command a) (Command Any)))
+(def: #export (do! command fs resolution profile)
+ (All [a]
+ (-> (-> (file.System Promise) Resolution (Command a))
+ (-> (file.System Promise) Resolution (Command Any))))
(do {! ///action.monad}
- [#let [fs (java/nio/file/FileSystems::getDefault)]
- watcher (promise.future (java/nio/file/FileSystem::newWatchService fs))
+ [watcher (promise.future
+ (java/nio/file/FileSystem::newWatchService
+ (java/nio/file/FileSystems::getDefault)))
targets (|> profile
(get@ #///.sources)
set.to-list
(monad.map ! ..targets)
(:: ! map list.concat))
_ (monad.map ! (..watch! watcher) targets)
- _ (command profile)]
+ _ (command fs resolution profile)]
(loop [_ []]
(do !
[?key (..poll! watcher)
@@ -143,7 +148,7 @@
(#.Some key)
(do !
[_ (promise.future (..drain! watcher))
- _ (command profile)]
+ _ (command fs resolution profile)]
(wrap []))
#.None