Files
orchid/src/systems/io/io.orc
Lawrence Bethlenfalvy 86e520e8b8 September-october commit
- manual parser
- stl refinements
- all language constructs are now Send
2023-10-11 18:27:50 +01:00

32 lines
548 B
Plaintext

import std::panic
import system::io
import system::async::yield
export const print := \text. \ok. (
io::write_str io::stdout text
(io::flush io::stdout
ok
(\e. panic "println threw on flush")
\_. yield
)
(\e. panic "print threw on write")
\_. yield
)
export const println := \line. \ok. (
print (line ++ "\n") ok
)
export const readln := \ok. (
io::read_line io::stdin
ok
(\e. panic "readln threw")
\_. yield
)
export module prelude (
import super::*
export ::(print, println, readln)
)