Lift lambdas in the scrutinized expression

This commit is contained in:
Martin Fredin 2023-03-29 16:37:52 +02:00
parent 2f12fdd7e2
commit c59cd02361

View file

@ -234,9 +234,10 @@ collectScsExp expT@(exp, typ) = case exp of
where
(scs, e') = collectScsExp e
ECase e branches -> (scs, (ECase e branches', typ))
ECase e branches -> (scs ++ scs_e, (ECase e' branches', typ))
where
(scs, branches') = mapAccumL f [] branches
(scs_e, e') = collectScsExp e
f acc b = (acc ++ acc', b')
where (acc', b') = collectScsBranch b