repl loopgit add .git add .!

This commit is contained in:
VegOwOtenks 2024-09-15 16:47:34 +02:00
parent 125f82f53a
commit 107f887147

View file

@ -1,6 +1,23 @@
module Main (main) where
import Lib
import Text.Parsec
import Lib (exprparser, evaluate)
import System.IO
main :: IO ()
main = someFunc
main = ioLoop
useResult (Right e) = show . evaluate $ e
useResult (Left e) = show e
ioLoop :: IO ()
ioLoop = do done <- isEOF
if done
then putStrLn "Quit!"
else do inp <- getLine
let expr = parse exprparser "<stdin>" inp
putStrLn . useResult $ expr
ioLoop