aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Main.hs
blob: 9c625899b9664df2bf7622a22e323fbf675aa035 (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
24
25
26
27
28
29
30
31
32
33
34
35
36
module Main
  ( main
  ) where

import           Lib
import           System.Environment             ( getArgs )
import           Term
import           Transpile

transpile :: IO ()
transpile = do
  args <- getArgs
  file <- readFile (head args)
  let term = fromBLC file
  putStrLn $ "input: " ++ show term
  let ski = transpileSKI term
  putStrLn $ "SKI transpiled: " ++ show ski
  let birb = transpileBirb ski
  putStrLn $ "Birb transpiled: " ++ show birb
  return ()

reduce :: IO ()
reduce = do
  args <- getArgs
  file <- readFile (head args)
  let termified   = fromBirbs file
  let rebirbified = fromTerm termified
  putStrLn $ "input: " ++ rebirbified
  normalBirbs <- nf termified
  let retermified = fromTerm normalBirbs
  putStrLn $ "reduced: " ++ retermified
  return ()

main :: IO ()
main = transpile
-- main = mapM_ (bruteForce "...") [1 .. 10]