diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/world/console.lux | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/lux/world/console.lux b/stdlib/source/lux/world/console.lux index 62beffb39..f84e51d03 100644 --- a/stdlib/source/lux/world/console.lux +++ b/stdlib/source/lux/world/console.lux @@ -1,4 +1,4 @@ -(;module: +(.module: [lux #- open] (lux (control [monad #+ do]) (data ["e" error] @@ -16,25 +16,25 @@ (close [] (Task Unit))) (for {"JVM" - (as-is (host;import java/lang/AutoCloseable + (as-is (host.import java/lang/AutoCloseable (close [] #io #try void)) - (host;import java/io/InputStream) + (host.import java/io/InputStream) - (host;import java/io/Reader) + (host.import java/io/Reader) - (host;import java/io/InputStreamReader + (host.import java/io/InputStreamReader (new [InputStream])) - (host;import java/io/BufferedReader + (host.import java/io/BufferedReader (new [Reader]) (read [] #io #try int) (readLine [] #io #try String)) - (host;import java/io/PrintStream + (host.import java/io/PrintStream (print [String] #io #try void)) - (host;import java/lang/System + (host.import java/lang/System (#static in java/io/InputStream) (#static out java/io/PrintStream)) @@ -46,29 +46,29 @@ (|>> get@Console (get@ #input) (BufferedReader::read []) - (:: io;Functor<Process> map (|>> int-to-nat text;from-code)) - promise;future)) + (:: io.Functor<Process> map (|>> int-to-nat text.from-code)) + promise.future)) (def: read-line (|>> get@Console (get@ #input) (BufferedReader::readLine []) - promise;future)) + promise.future)) (def: (write message) (|>> get@Console (get@ #output) (PrintStream::print [message]) - promise;future)) + promise.future)) (def: (close self) - (promise;future - (do io;Monad<Process> + (promise.future + (do io.Monad<Process> [_ (AutoCloseable::close [] (|> self get@Console (get@ #input)))] (AutoCloseable::close [] (|> self get@Console (get@ #output))))))) (def: #export open (Process Console) - (io (#e;Success (new@JVM-Console {#input (|> System::in InputStreamReader::new BufferedReader::new) + (io (#e.Success (new@JVM-Console {#input (|> System::in InputStreamReader::new BufferedReader::new) #output System::out}))))) }) |