summaryrefslogtreecommitdiff
path: root/src/Simplify.hs
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2024-09-03 17:00:08 +0200
committerTom Smeding <t.j.smeding@uu.nl>2024-09-03 17:00:08 +0200
commit40a6868ed5960d381359541975272483747808b4 (patch)
treeaeda3bdf22bd3fef5366b37cb78b5cbf8c7018c7 /src/Simplify.hs
parente281439863d7e760a60b573f53604aac5e737984 (diff)
Inching towards drev of build
Diffstat (limited to 'src/Simplify.hs')
-rw-r--r--src/Simplify.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Simplify.hs b/src/Simplify.hs
index af0ca4c..f2fc54a 100644
--- a/src/Simplify.hs
+++ b/src/Simplify.hs
@@ -73,13 +73,14 @@ simplify' = \case
EBuild1 _ a b -> EBuild1 ext (simplify' a) (simplify' b)
EBuild _ es e -> EBuild ext (fmap simplify' es) (simplify' e)
EFold1 _ a b -> EFold1 ext (simplify' a) (simplify' b)
+ EUnit _ e -> EUnit ext (simplify' e)
EConst _ t v -> EConst ext t v
EIdx0 _ e -> EIdx0 ext (simplify' e)
EIdx1 _ a b -> EIdx1 ext (simplify' a) (simplify' b)
EIdx _ e es -> EIdx ext (simplify' e) (fmap simplify' es)
EOp _ op e -> EOp ext op (simplify' e)
EWith e1 e2 -> EWith (simplify' e1) (let ?accumInScope = True in simplify' e2)
- EAccum e1 e2 e3 -> EAccum (simplify' e1) (simplify' e2) (simplify' e3)
+ EAccum1 e1 e2 e3 -> EAccum1 (simplify' e1) (simplify' e2) (simplify' e3)
EError t s -> EError t s
cheapExpr :: Expr x env t -> Bool
@@ -105,13 +106,14 @@ hasAdds = \case
EBuild1 _ a b -> hasAdds a || hasAdds b
EBuild _ es e -> getAny (foldMap (Any . hasAdds) es) || hasAdds e
EFold1 _ a b -> hasAdds a || hasAdds b
+ EUnit _ e -> hasAdds e
EConst _ _ _ -> False
EIdx0 _ e -> hasAdds e
EIdx1 _ a b -> hasAdds a || hasAdds b
EIdx _ e es -> hasAdds e || getAny (foldMap (Any . hasAdds) es)
EOp _ _ e -> hasAdds e
EWith a b -> hasAdds a || hasAdds b
- EAccum _ _ _ -> True
+ EAccum1 _ _ _ -> True
EError _ _ -> False
checkAccumInScope :: SList STy env -> Bool