1 
    2 
    3   module Main where
    4 
    5 
    6   import LambdaLift
    7   import Utilities
    8   import Print
    9   import Test
   10 
   11   main =
   12 
   13         putStr ("\nInput expression " ++ pprintExpr inputExpr ++
   14                 "\nResult\n" ++ output ++
   15                 "\nFully lazy \n" ++ pprintSCs (fullyLazyLift inputExpr) ++
   16                 "\n")
   17       where
   18       inputExpr = program
   19       output = pprintSCs (lambdaLift inputExpr)
   20 
   21   {- OLD: 1.2
   22   main ~(Str argString : ~(Str input : rest)) = 
   23 
   24 
   25 
   26 
   27         AppendChan stdout ( -- "Args " ++ argString ++
   28 
   29                 -- "\nInput file " ++ file ++ 
   30                 -- "\nInput data " ++ input ++
   31 
   32                 "\nInput expression " ++ pprintExpr inputExpr ++
   33                 "\nResult\n" ++ output ++
   34                 "\nFully lazy \n" ++ pprintSCs (fullyLazyLift inputExpr) ++
   35                 "\n") :
   36         []
   37   
   38       where
   39       args = my_splitAt '\n' argString
   40       file = args !! 0
   41       inputExpr = program
   42       output = pprintSCs (lambdaLift inputExpr)
   43  -}
   44 
   45 
   46 
   47 
   48 
   49 
   50   my_splitAt x [] = [[]]
   51   my_splitAt x (y:ys) | y == x    =  [] : my_splitAt x ys
   52                    | otherwise =  (y:ys1) : yss where (ys1:yss) = my_splitAt x ys