@@ -53,19 +53,21 @@ import Language.PureScript.Optimizer.Blocks
5353--
5454optimize :: Options -> JS -> JS
5555optimize opts | optionsNoOptimizations opts = id
56− | otherwise = untilFixedPoint $ applyAll
56+ | otherwise = untilFixedPoint (applyAll
5757 [ collapseNestedBlocks
5858 , tco opts
5959 , magicDo opts
6060 , removeUnusedVariables
61+ , removeCodeAfterReturnStatements
6162 , unThunk
6263 , etaConvert
64+ , evaluateIifes
6365 , inlineVariables
6466 , inlineOperator (C.$) $ \f x -> JSApp f [x]
6567 , inlineOperator (C.#) $ \x f -> JSApp f [x]
6668 , inlineOperator (C.!!) $ flip JSIndexer
6769 , inlineOperator (C.++) $ JSBinary Add
68− , inlineCommonOperators ]
70+ , inlineCommonOperators ])
6971
7072untilFixedPoint :: (Eq a) => (a -> a) -> a -> a
7173untilFixedPoint f = go