20 lines
464 B
Haskell
20 lines
464 B
Haskell
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
|