From 9825d231a90e0763218bb956f7894f24ab4836db Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 3 Oct 2023 16:29:50 +0200 Subject: Initial commit --- app/Main.hs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/Main.hs (limited to 'app') diff --git a/app/Main.hs b/app/Main.hs new file mode 100644 index 0000000..913bbb2 --- /dev/null +++ b/app/Main.hs @@ -0,0 +1,23 @@ +module Main + ( main + ) where + +import Lib +import System.Environment ( getArgs ) +import Term + +reduce :: String -> IO () +reduce path = do + file <- readFile path + let termified = fromJotter file + putStrLn $ "input: " ++ show termified + normal <- nf termified + putStrLn $ "reduced: " ++ show normal + +main :: IO () +main = do + args <- getArgs + case args of + -- ["transpile", path] -> transpile path + ["reduce", path] -> reduce path + _ -> putStrLn "Usage: jotter [transpile|reduce] " -- cgit v1.2.3