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
subeverywhere trans (Lit x) = return $ Lit x
subeverywhere trans (Type x) = return $ Type x
-subeverywhere trans expr = error $ "NormalizeTools.subeverywhere Unsupported expression: " ++ show expr
+subeverywhere trans (Cast expr ty) = do
+ expr' <- trans expr
+ return $ Cast expr' ty
+
+subeverywhere trans expr = error $ "\nNormalizeTools.subeverywhere: Unsupported expression: " ++ show expr
-- Apply the given transformation to all expressions, except for direct
-- arguments of an application