From c59cd02361f7371d1583b324e001fcf7849c059e Mon Sep 17 00:00:00 2001 From: Martin Fredin Date: Wed, 29 Mar 2023 16:37:52 +0200 Subject: [PATCH] Lift lambdas in the scrutinized expression --- src/LambdaLifter.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/LambdaLifter.hs b/src/LambdaLifter.hs index 5020fb6..d6d1945 100644 --- a/src/LambdaLifter.hs +++ b/src/LambdaLifter.hs @@ -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