aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Main.hs
blob: 913bbb20d0faf219516f7e405c204be2d97a6e6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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] <file>"