Inference on most expressions. HM based.

Still have to figure out how to infer type of lambda variables, as well
as how function application on polymorphic should work
This commit is contained in:
sebastianselander 2023-02-13 12:17:49 +01:00
parent a1e9624d5e
commit 73dc2e4b6a
12 changed files with 347 additions and 310 deletions

View file

@ -3,7 +3,6 @@ module Main where
import Grammar.Par (myLexer, pProgram)
import Grammar.Print (printTree)
import LambdaLifter (lambdaLift)
import System.Environment (getArgs)
import System.Exit (exitFailure, exitSuccess)
@ -17,17 +16,4 @@ main = getArgs >>= \case
putStrLn "SYNTAX ERROR"
putStrLn err
exitFailure
Right prg -> do
putStrLn "-- Parse"
putStrLn $ printTree prg
-- putStrLn "\n-- Abstract"
-- putStrLn . printTree $ (abstract . freeVars) prg
-- putStrLn "\n-- Rename"
-- putStrLn . printTree $ (rename . abstract . freeVars) prg
putStrLn "\n-- Lamda lifter"
putStrLn . printTree $ lambdaLift prg
putStrLn ""
exitSuccess
Right prg -> putStrLn "NO SYNTAX ERROR"