@@ -40,7 +40,6 @@ data Expr = IntNum Int
4040 | Binop String CExpr CExpr
4141 | Lambda String CExpr
4242 | App CExpr CExpr
43− | If CExpr CExpr CExpr
4443 | MultiIf [(CExpr,CExpr)]
4544 | Let [Def] CExpr
4645 | Var String
@@ -118,7 +117,6 @@ instance Show Expr where
118117 Lambda x e -> let (xs,e') = getLambdas (notLocated $ Lambda x e) in
119118 concat [ "\\", intercalate " " xs, " -> ", show e' ]
120119 App e1 e2 -> show' e1 ++ " " ++ show' e2
121− If e1 e2 e3 -> concat [ "if ", show e1, " then ", show e2, " else ", show e3 ]
122120 MultiIf (p:ps) -> concat [ "if | ", iff p, sep (map iff ps) ]
123121 where iff (b,e) = show b ++ " -> " ++ show e
124122 sep = concatMap ("\n | " ++)
@@ -149,10 +147,10 @@ getLambdas e = ([],e)
149147needsParens e =
150148 case e of
151149 Binop _ _ _ -> True
152− Lambda _ _ -> True
153− App _ _ -> True
154− If _ _ _ -> True
155− Let _ _ -> True
156− Case _ _ -> True
150+ Lambda _ _ -> True
151+ App _ _ -> True
152+ MultiIf _ -> True
153+ Let _ _ -> True
154+ Case _ _ -> True
157155 Data name (x:xs) -> name /= "Cons"
158156 _ -> False