From 8bd1d1b3a4750b26f1540717839c1aa196f2a520 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 17 May 2017 20:23:02 -0400 Subject: - Renamed "Error" to "Result". --- new-luxc/source/luxc/io.jvm.lux | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'new-luxc/source/luxc/io.jvm.lux') 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/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 [?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 [ code])))) + (#R;Success code) + (wrap (#R;Success [ code])))) #;None)] [host-path] [lux-path])] (<| - (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)) -- cgit v1.2.3