module Main where import Eval import Lexer import Parser import REPL (repl) import Research import qualified Data.Map as Map import Text.Megaparsec (runParser) main :: IO () main = repl library runSapling :: String -> String runSapling s = show $ result (evalSapling Map.empty $ parseSapling s) library = evalSapling Map.empty $ parseSapling "false = t\n \ \ true = t t\n \ \ id = (\\a : a)\n \ \ 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)" runSaplingEnv env s = show $ result (evalSapling env $ parseSapling s)