aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
authorEduardo Julian2020-07-16 23:19:57 -0400
committerEduardo Julian2020-07-16 23:19:57 -0400
commit80c727065593a4cadcb1d72c38c8ad5c3bf85acc (patch)
tree2f01222debb9a4756dfe3f26d41af660742487c9 /stdlib/source/program
parentde1d6adc6657feb81332db8620094dd8de150b96 (diff)
Can get the JS compiler to compile its own source-code.
Diffstat (limited to 'stdlib/source/program')
-rw-r--r--stdlib/source/program/compositor.lux45
1 files changed, 29 insertions, 16 deletions
diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux
index 63c398bf9..95ad2c771 100644
--- a/stdlib/source/program/compositor.lux
+++ b/stdlib/source/program/compositor.lux
@@ -24,7 +24,8 @@
["." list ("#@." functor fold)]]]
[world
["." file (#+ File Path)]
- ["." console]]
+ ## ["." console]
+ ]
[tool
[compiler
["." phase]
@@ -73,21 +74,33 @@
(def: (package! monad file-system [packager package] static archive context)
(All [!] (-> (Monad !) (file.System !) [Packager Path] Static Archive Context (! (Try Any))))
- (do (try.with monad)
- [#let [packager (:share [!] {(Monad !) monad} {(Packager !) packager})]
- content (packager monad file-system static archive context)
- package (:share [!]
- {(Monad !)
- monad}
- {(! (Try (File !)))
- (:assume (file.get-file monad file-system package))})]
- (!.use (:: (:share [!]
- {(Monad !)
- monad}
- {(File !)
- (:assume package)})
- over-write)
- [content])))
+ (for {@.old
+ (do (try.with monad)
+ [#let [packager (:share [!] {(Monad !) monad} {(Packager !) packager})]
+ content (packager monad file-system static archive context)
+ package (:share [!]
+ {(Monad !)
+ monad}
+ {(! (Try (File !)))
+ (:assume (file.get-file monad file-system package))})]
+ (!.use (:: (:share [!]
+ {(Monad !)
+ monad}
+ {(File !)
+ (:assume package)})
+ over-write)
+ [content]))}
+ ## TODO: Fix whatever type-checker bug is forcing me into this compromise...
+ (:assume
+ (: (Promise (Try Any))
+ (let [monad (:coerce (Monad Promise) monad)
+ file-system (:coerce (file.System Promise) monad)
+ packager (:coerce (Packager Promise) packager)]
+ (do (try.with monad)
+ [content (packager monad file-system static archive context)
+ package (: (Promise (Try (File Promise)))
+ (file.get-file monad file-system package))]
+ (!.use (:: (: (File Promise) package) over-write) [content])))))))
(with-expansions [<parameters> (as-is anchor expression artifact)]
(def: #export (compiler static