in midst of refactor

This commit is contained in:
2024-04-29 21:46:42 +02:00
parent ed0d64d52e
commit aa3f7e99ab
221 changed files with 5431 additions and 685 deletions

View File

@@ -0,0 +1,35 @@
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 const prompt := \line. \ok. (
print line (readln ok)
)
export module prelude (
import super::*
export ::(print, println, readln, prompt)
)