This commit is contained in:
2020-02-06 09:58:52 +01:00
commit 396f9615a1
6 changed files with 145 additions and 0 deletions

19
src/App.hs Normal file
View File

@@ -0,0 +1,19 @@
module Main where
import Data.List (intercalate)
import System.Environment (getArgs)
import System.IO (hPutStrLn, stderr)
import Infer.Treat (run)
main :: IO ()
main = do
args <- getArgs
if length args < 2
then errln "Expected at least two arguments."
else
case run (head args) (tail args) of
Left e -> errln e
Right v ->
putStrLn $ "Inferred the following statements: " ++ (intercalate ", " v)
where errln = hPutStrLn stderr