perga/app/Main.hs

18 lines
380 B
Haskell

module Main where
import Check
import Expr
import Parser
import System.IO
main :: IO ()
main = do
_ <- putStr "> "
_ <- hFlush stdout
input <- getLine
case pAll input of
Left err -> putStrLn err
Right expr -> case findType [] expr of
Right ty -> putStrLn $ pretty expr ++ " : " ++ pretty ty
Left err -> print err
main