diff options
author | Eduardo Julian | 2017-10-18 12:42:46 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-18 12:42:46 -0400 |
commit | 901b09dada43ec6f3b21618800ec7400fda54a0d (patch) | |
tree | d62dde3df2ce4fd7d7cd8d0b177f6592f87817cb /new-luxc/source/luxc/io.jvm.lux | |
parent | 14e381de130f0c8d3e333cf0523c6c98b9aa84b1 (diff) |
- Updated to the latest changes in stdlib.
Diffstat (limited to 'new-luxc/source/luxc/io.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/io.jvm.lux | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/new-luxc/source/luxc/io.jvm.lux b/new-luxc/source/luxc/io.jvm.lux index e8f403d6d..9ca8aebf3 100644 --- a/new-luxc/source/luxc/io.jvm.lux +++ b/new-luxc/source/luxc/io.jvm.lux @@ -3,10 +3,10 @@ (lux (control monad) [io #- run] (concurrency ["P" promise]) - (data ["R" result] + (data ["e" error] [text "T/" Eq<Text>] text/format) - [macro] + [meta] [host]) (luxc ["&" base])) @@ -45,26 +45,26 @@ (recur source-dirs')))))) (def: (read-source-code lux-file) - (-> File (P;Promise (R;Result Text))) + (-> File (P;Promise (e;Error Text))) (P;future (let [reader (|> lux-file FileReader.new BufferedReader.new)] (loop [total ""] (do Monad<IO> [?line (BufferedReader.readLine [] reader)] (case ?line - (#R;Error error) - (wrap (#R;Error error)) + (#e;Error error) + (wrap (#e;Error error)) - (#R;Success #;None) - (wrap (#R;Success total)) + (#e;Success #;None) + (wrap (#e;Success total)) - (#R;Success (#;Some line)) + (#e;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 (R;Result [&;Path Text]))) + (-> (List &;Path) Text (P;Promise (e;Error [&;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 - (#R;Error error) - (wrap (#R;Error error)) + (#e;Error error) + (wrap (#e;Error error)) - (#R;Success code) - (wrap (#R;Success [<path> code])))) + (#e;Success code) + (wrap (#e;Success [<path> code])))) #;None)] [host-path] [lux-path])] (<| <tries> - (wrap (#R;Error (format "Module cannot be found: " module-name))))))) + (wrap (#e;Error (format "Module cannot be found: " module-name))))))) (def: #export (write-module module-name module-descriptor) (-> Text Text (P;Promise Unit)) |