aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool/compiler/default/platform.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-04-19 02:19:33 -0400
committerEduardo Julian2020-04-19 02:19:33 -0400
commit6d26d72e557eef73959846876dff7f14d8185d68 (patch)
tree87622798ddbfcc344cdb65603a8a61cd75392229 /stdlib/source/lux/tool/compiler/default/platform.lux
parenta5e87f66c4588ac23201d00cc55a748b6088eb96 (diff)
Fixed some compilation bugs.
Diffstat (limited to 'stdlib/source/lux/tool/compiler/default/platform.lux')
-rw-r--r--stdlib/source/lux/tool/compiler/default/platform.lux20
1 files changed, 13 insertions, 7 deletions
diff --git a/stdlib/source/lux/tool/compiler/default/platform.lux b/stdlib/source/lux/tool/compiler/default/platform.lux
index 7419ddac5..1f68030bd 100644
--- a/stdlib/source/lux/tool/compiler/default/platform.lux
+++ b/stdlib/source/lux/tool/compiler/default/platform.lux
@@ -52,6 +52,15 @@
#runtime (///generation.Operation anchor expression directive Any)
#write (-> directive Binary)})
+## TODO: Get rid of this
+(type: (Action a)
+ (Promise (Try a)))
+
+## TODO: Get rid of this
+(def: monad
+ (:coerce (Monad Action)
+ (try.with promise.monad)))
+
(with-expansions [<type-vars> (as-is [anchor expression directive])
<Platform> (as-is (Platform anchor expression directive))
<State+> (as-is (///directive.State+ anchor expression directive))
@@ -62,18 +71,15 @@
(-> <Platform> Host Path Path archive.ID Text Output
(Promise (Try Any))))
(let [system (get@ #&file-system platform)
- write-artifact! (: (-> [Text Binary] (Promise (Try Any)))
+ write-artifact! (: (-> [Text Binary] (Action Any))
(function (_ [name content])
(ioW.write system host target-dir module-id name extension content)))]
- (do (try.with promise.monad)
+ (do ..monad
[_ (ioW.prepare system host target-dir module-id)
_ (|> output
row.to-list
- (monad.map promise.monad
- write-artifact!)
- (: (Promise (List (Try Any))))
- (promise@map (monad.seq try.monad))
- (: (Promise (Try (List Any)))))]
+ (monad.map ..monad write-artifact!)
+ (: (Action (List Any))))]
(wrap [])
## (&io.write target-dir
## (format module-name "/" cache.descriptor-name)