X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=NormalizeTools.hs;h=f016cfa9fc34684604a8efe487ac8f254297d5c3;hb=30414e977c5c4ba3c16441a281601c7c68f0fb6e;hp=c20c58349491ee5aa75a5fe8348fe1fa4623ca13;hpb=d88c25bace830adf56cc5a3978b39aaf603353d3;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/NormalizeTools.hs b/NormalizeTools.hs index c20c583..f016cfa 100644 --- a/NormalizeTools.hs +++ b/NormalizeTools.hs @@ -119,6 +119,11 @@ subeverywhere trans (App a b) = do b' <- trans b return $ App a' b' +subeverywhere trans (Let (NonRec b bexpr) expr) = do + bexpr' <- trans bexpr + expr' <- trans expr + return $ Let (NonRec b bexpr') expr' + subeverywhere trans (Let (Rec binds) expr) = do expr' <- trans expr binds' <- mapM transbind binds @@ -147,6 +152,10 @@ subeverywhere trans (Var x) = return $ Var x subeverywhere trans (Lit x) = return $ Lit x subeverywhere trans (Type x) = return $ Type x +subeverywhere trans (Cast expr ty) = do + expr' <- trans expr + return $ Cast expr' ty + subeverywhere trans expr = error $ "NormalizeTools.subeverywhere Unsupported expression: " ++ show expr -- Apply the given transformation to all expressions, except for direct