open CS334 let rec repl() = printf "Enter an expression (type 'quit' to quit): " let input = System.Console.ReadLine() if input = "quit" then printfn "Goodbye!" exit 0 else // parsing can fail, so we made it return an 'Expr option' type // pattern match to get Some AST or None AST. let ast_maybe = parse input match ast_maybe with | Some ast -> printfn "%A" ast | None -> () // do nothing (returns unit) repl() [] let main args = repl() 0