aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Main.hs')
-rw-r--r--app/Main.hs16
1 files changed, 12 insertions, 4 deletions
diff --git a/app/Main.hs b/app/Main.hs
index c1f1c2d..cbcaeac 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE LambdaCase #-}
-
module Main
( main
) where
@@ -7,6 +5,15 @@ module Main
import Lib
import System.Environment ( getArgs )
import Term
+import Transpile
+
+transpile :: String -> IO ()
+transpile path = do
+ file <- readFile path
+ let term = fromBLC file
+ let ski = transpileSKI term
+ let jottary = transpileJottary ski
+ putStrLn jottary
reduce :: String -> IO ()
reduce path = do
@@ -20,5 +27,6 @@ main :: IO ()
main = do
args <- getArgs
case args of
- ["reduce", path] -> reduce path
- _ -> putStrLn "Usage: jottary [transpile|reduce] <file>"
+ ["transpile", path] -> transpile path
+ ["reduce" , path] -> reduce path
+ _ -> putStrLn "Usage: jottary [transpile|reduce] <file>"