Let casesimpl generate non-recursive lets.
[matthijs/master-project/cλash.git] / cλash / CLasH / Normalize.hs
index cd3ba5817ca1e04384185d74dd7e50f113059d61..bade853af128b07cfb1c570d9e7b07805948bd04 100644 (file)
@@ -308,7 +308,7 @@ casesimpl expr@(Case scrut b ty alts) = do
   (bindingss, alts') <- (Monad.liftM unzip) $ mapM doalt alts
   let bindings = concat bindingss
   -- Replace the case with a let with bindings and a case
-  let newlet = (Let (Rec bindings) (Case scrut b ty alts'))
+  let newlet = mkNonRecLets bindings (Case scrut b ty alts')
   -- If there are no non-wild binders, or this case is already a simple
   -- selector (i.e., a single alt with exactly one binding), already a simple
   -- selector altan no bindings (i.e., no wild binders in the original case),