git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Don't inline fromNumber
commitf08bedf71594f29e2dffbaebdfc1efd08e6b6088 authorGary Burgess <gary.burgess@gmail.com> dateSat 6 Jun 2015, 21:29 (11 years ago) parent58acfae
2 files changed−5
src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs−2 src/Language/PureScript/Constants.hs−3
src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs−2
@@ -97,7 +97,6 @@ inlineValues = everywhereOnJS convert
9797 | isDict semiringInt dict && isFn fnOne fn = JSNumericLiteral (Left 1)
9898 | isDict boundedBoolean dict && isFn fnBottom fn = JSBooleanLiteral False
9999 | isDict boundedBoolean dict && isFn fnTop fn = JSBooleanLiteral True
100− convert (JSApp fn [value]) | isFn fromNumber fn = JSBinary BitwiseOr value (JSNumericLiteral (Left 0))
101100 convert (JSApp (JSApp (JSApp fn [dict]) [x]) [y])
102101 | isDict semiringInt dict && isFn fnAdd fn = JSBinary BitwiseOr (JSBinary Add x y) (JSNumericLiteral (Left 0))
103102 | isDict semiringInt dict && isFn fnMultiply fn = JSBinary BitwiseOr (JSBinary Multiply x y) (JSNumericLiteral (Left 0))
@@ -108,7 +107,6 @@ inlineValues = everywhereOnJS convert
108107 fnOne = (C.prelude, C.one)
109108 fnBottom = (C.prelude, C.bottom)
110109 fnTop = (C.prelude, C.top)
111− fromNumber = (C.dataInt, C.fromNumber)
112110 fnAdd = (C.prelude, (C.+))
113111 fnDivide = (C.prelude, (C./))
114112 fnMultiply = (C.prelude, (C.*))
src/Language/PureScript/Constants.hs−3
@@ -115,9 +115,6 @@ zshr = "zshr"
115115complement :: String
116116complement = "complement"
117117
118−fromNumber :: String
119−fromNumber = "fromNumber"
120−
121118-- Prelude Values
122119
123120zero :: String