From 901b09dada43ec6f3b21618800ec7400fda54a0d Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 18 Oct 2017 12:42:46 -0400 Subject: - Updated to the latest changes in stdlib. --- new-luxc/source/luxc/io.jvm.lux | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 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 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/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 [?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 [ code])))) + (#e;Success code) + (wrap (#e;Success [ code])))) #;None)] [host-path] [lux-path])] (<| - (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)) -- cgit v1.2.3