From f6b5850f949eb671f0c7038db6dff80ca23ed946 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 23 Jul 2025 21:09:59 +0200 Subject: WIP pruneExpr in AST.Count --- src/Simplify.hs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/Simplify.hs') diff --git a/src/Simplify.hs b/src/Simplify.hs index 74b6601..28b6d60 100644 --- a/src/Simplify.hs +++ b/src/Simplify.hs @@ -200,6 +200,7 @@ simplify'Rec = \case EMaybe ext (ESnd ext e1) (ESnd ext e2) e3 -- TODO: more array indexing + EIdx _ (EBuild _ _ _ e1) e2 -> acted $ simplify' $ elet e2 e1 EIdx _ (EReplicate1Inner _ _ e2) e3 -> acted $ simplify' $ EIdx ext e2 (EFst ext e3) EIdx _ (EUnit _ e1) _ -> acted $ simplify' $ e1 @@ -336,16 +337,6 @@ simplify'Rec = \case EPlus _ t a b -> [simprec| EPlus ext t *a *b |] EError _ t s -> pure $ EError ext t s -cheapExpr :: Expr x env t -> Bool -cheapExpr = \case - EVar{} -> True - ENil{} -> True - EConst{} -> True - EFst _ e -> cheapExpr e - ESnd _ e -> cheapExpr e - EUnit _ e -> cheapExpr e - _ -> False - -- | This can be made more precise by tracking (and not counting) adds on -- locally eliminated accumulators. hasAdds :: Expr x env t -> Bool -- cgit v1.2.3-70-g09d2