diff options
author | Eduardo Julian | 2017-05-17 20:23:02 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-17 20:23:02 -0400 |
commit | 8bd1d1b3a4750b26f1540717839c1aa196f2a520 (patch) | |
tree | cc9d595998c3bf4d15e434480f5505fd491e39b0 /new-luxc/source/luxc/io.jvm.lux | |
parent | 824482b2e8b13e42a524a5e4945ea3e172395c9e (diff) |
- Renamed "Error" to "Result".
Diffstat (limited to 'new-luxc/source/luxc/io.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/io.jvm.lux | 26 |
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)) |