From: Matthijs Kooijman Date: Tue, 23 Jun 2009 12:27:48 +0000 (+0200) Subject: Make subeverywhere complain for unknown expressions. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=d88c25bace830adf56cc5a3978b39aaf603353d3;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Make subeverywhere complain for unknown expressions. Previously, subeverywhere would silently leave it unmodified. --- diff --git a/NormalizeTools.hs b/NormalizeTools.hs index 400bf88..c20c583 100644 --- a/NormalizeTools.hs +++ b/NormalizeTools.hs @@ -142,9 +142,12 @@ subeverywhere trans (Case scrut b t alts) = do transalt (con, binders, expr) = do expr' <- trans expr return (con, binders, expr') - -subeverywhere trans expr = return expr +subeverywhere trans (Var x) = return $ Var x +subeverywhere trans (Lit x) = return $ Lit x +subeverywhere trans (Type x) = return $ Type x + +subeverywhere trans expr = error $ "NormalizeTools.subeverywhere Unsupported expression: " ++ show expr -- Apply the given transformation to all expressions, except for direct -- arguments of an application