Automatic decoding of supported literals in REPL

Automatic decoding & display of string, number, and list types in REPL.
General updates to README, style, and comments.
This commit is contained in:
James Eversole
2024-12-27 15:40:50 -06:00
parent 4495f8eba0
commit 0dd14a3aea
6 changed files with 86 additions and 23 deletions

View File

@ -15,6 +15,7 @@ main = repl library
runSapling :: String -> String
runSapling s = show $ result (evalSapling Map.empty $ parseSapling s)
library :: Map.Map String T
library = evalSapling Map.empty $ parseSapling
"false = t\n \
\ true = t t\n \
@ -22,6 +23,8 @@ library = evalSapling Map.empty $ parseSapling
\ triage = (\\a b c : t (t a b) c)\n \
\ match_bool = (\\ot of : triage of (\\z : ot) t)\n \
\ and = match_bool id (\\z : false)\n \
\ if = (\\cond then else : t (t else (t t then)) t cond)"
\ if = (\\cond then else : t (t else (t t then)) t cond)\n \
\ triage = (\\a b c : t (t a b) c)\n \
\ test = triage \"leaf\" (\\z : \"stem\") (\\a b : \"fork\")"
runSaplingEnv env s = show $ result (evalSapling env $ parseSapling s)