@@ -19,6 +19,7 @@ module Language.PureScript.CodeGen.JS.Optimizer.Inliner (
19 inlineOperator,
19 inlineOperator,
20 inlineCommonOperators,
20 inlineCommonOperators,
21 inlineAppliedArrComposition,
21 inlineAppliedArrComposition,
22 etaConvert,
23 etaConvert,
24 evaluateIifes
25 evaluateIifes
@@ -246,6 +247,13 @@ inlineAppliedArrComposition = everywhereOnJS convert
246 convert (JSApp (JSApp (JSApp (JSApp fn [dict']) [x]) [y]) [z]) | isDict semigroupoidArr dict' && isPreludeFn (C.<<<) fn = JSApp x [JSApp y [z]]
247 convert (JSApp (JSApp (JSApp (JSApp fn [dict']) [x]) [y]) [z]) | isDict semigroupoidArr dict' && isPreludeFn (C.<<<) fn = JSApp x [JSApp y [z]]
247 convert other = other
248 convert other = other
250+inlineAppliedVars :: JS -> JS
251+inlineAppliedVars = everywhereOnJS convert
254+ convert (JSApp (JSFunction Nothing [a] (JSBlock [JSReturn b])) [JSVar x]) = replaceIdent a (JSVar x) b
255+ convert other = other
249isDict :: (String, String) -> JS -> Bool
257isDict :: (String, String) -> JS -> Bool
250isDict (moduleName, dictName) (JSAccessor x (JSVar y)) = x == dictName && y == moduleName
258isDict (moduleName, dictName) (JSAccessor x (JSVar y)) = x == dictName && y == moduleName
251isDict _ _ = False
259isDict _ _ = False