perga/app/Main.hs

18 lines
428 B
Haskell

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