git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Expand one of the inliner rules to enable better TCO
0bc8dddPhil Freeman
src/Language/PureScript/Optimizer/Inliner.hs+5−1
@@ -53,7 +53,11 @@ unThunk :: JS -> JS
53unThunk = everywhereOnJS convert
53unThunk = everywhereOnJS convert
54 where
54 where
55 convert :: JS -> JS
55 convert :: JS -> JS
56+ convert (JSBlock []) = JSBlock []
57+ convert (JSBlock jss) =
58+ case (last jss) of
56− convert (JSBlock [JSReturn (JSApp (JSFunction Nothing [] (JSBlock body)) [])]) = JSBlock body
59+ JSReturn (JSApp (JSFunction Nothing [] (JSBlock body)) []) -> JSBlock $ init jss ++ body
60+ _ -> JSBlock jss
57 convert js = js
61 convert js = js
58
62
59evaluateIifes :: JS -> JS
63evaluateIifes :: JS -> JS