Added more comments to the code

This commit is contained in:
sebastianselander 2023-02-22 15:24:38 +01:00
parent 8065576c31
commit 5daa5573f2
3 changed files with 18 additions and 9 deletions

View file

@ -25,7 +25,7 @@ data Exp
instance Show Exp where
show (EId t (Ident i)) = i ++ " : " ++ show t
show (EInt _ i) = show i
show (ELet t i e1 e2) = error "Show for let not implemented"
show (ELet t i e1 e2) = "let " ++ show t ++ " = " ++ show e1 ++ " in " ++ show e2
show (EApp t e1 e2) = show e1 ++ " " ++ show e2 ++ " : " ++ show t
show (EAdd _ e1 e2) = show e1 ++ " + " ++ show e2
show (EAbs t (Ident i) e) = "\\ " ++ i ++ ". " ++ show e ++ " : " ++ show t