aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/io.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/io.jvm.lux26
1 files changed, 13 insertions, 13 deletions
diff --git a/new-luxc/source/luxc/io.jvm.lux b/new-luxc/source/luxc/io.jvm.lux
index 18142e77a..cb37c69a9 100644
--- a/new-luxc/source/luxc/io.jvm.lux
+++ b/new-luxc/source/luxc/io.jvm.lux
@@ -3,7 +3,7 @@
(lux (control monad)
[io #- run]
(concurrency ["P" promise])
- (data ["E" error]
+ (data ["R" result]
[text "T/" Eq<Text>]
text/format)
[macro]
@@ -45,26 +45,26 @@
(recur source-dirs'))))))
(def: (read-source-code lux-file)
- (-> File (P;Promise (E;Error Text)))
+ (-> File (P;Promise (R;Result Text)))
(P;future
(let [reader (|> lux-file FileReader.new BufferedReader.new)]
(loop [total ""]
(do Monad<IO>
[?line (BufferedReader.readLine [] reader)]
(case ?line
- (#E;Error error)
- (wrap (#E;Error error))
+ (#R;Error error)
+ (wrap (#R;Error error))
- (#E;Success #;None)
- (wrap (#E;Success total))
+ (#R;Success #;None)
+ (wrap (#R;Success total))
- (#E;Success (#;Some line))
+ (#R;Success (#;Some line))
(if (T/= "" total)
(recur line)
(recur (format total "\n" line)))))))))
(def: #export (read-module source-dirs module-name)
- (-> (List &;Path) Text (P;Promise (E;Error [&;Path Text])))
+ (-> (List &;Path) Text (P;Promise (R;Result [&;Path Text])))
(let [host-path (format module-name host-extension ".lux")
lux-path (format module-name ".lux")]
(with-expansions
@@ -76,18 +76,18 @@
(do @
[?code (read-source-code file)]
(case ?code
- (#E;Error error)
- (wrap (#E;Error error))
+ (#R;Error error)
+ (wrap (#R;Error error))
- (#E;Success code)
- (wrap (#E;Success [<path> code]))))
+ (#R;Success code)
+ (wrap (#R;Success [<path> code]))))
#;None)]
[host-path]
[lux-path])]
(<| <tries>
- (wrap (#E;Error (format "Module cannot be found: " module-name)))))))
+ (wrap (#R;Error (format "Module cannot be found: " module-name)))))))
(def: #export (write-module module-name module-descriptor)
(-> Text Text (P;Promise Unit))