git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Don't inline fromNumber
f08bedfGary Burgess
src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs−2
@@ -97,7 +97,6 @@ inlineValues = everywhereOnJS convert
97 | isDict semiringInt dict && isFn fnOne fn = JSNumericLiteral (Left 1)
97 | isDict semiringInt dict && isFn fnOne fn = JSNumericLiteral (Left 1)
98 | isDict boundedBoolean dict && isFn fnBottom fn = JSBooleanLiteral False
98 | isDict boundedBoolean dict && isFn fnBottom fn = JSBooleanLiteral False
99 | isDict boundedBoolean dict && isFn fnTop fn = JSBooleanLiteral True
99 | isDict boundedBoolean dict && isFn fnTop fn = JSBooleanLiteral True
100− convert (JSApp fn [value]) | isFn fromNumber fn = JSBinary BitwiseOr value (JSNumericLiteral (Left 0))
101 convert (JSApp (JSApp (JSApp fn [dict]) [x]) [y])
100 convert (JSApp (JSApp (JSApp fn [dict]) [x]) [y])
102 | isDict semiringInt dict && isFn fnAdd fn = JSBinary BitwiseOr (JSBinary Add x y) (JSNumericLiteral (Left 0))
101 | isDict semiringInt dict && isFn fnAdd fn = JSBinary BitwiseOr (JSBinary Add x y) (JSNumericLiteral (Left 0))
103 | isDict semiringInt dict && isFn fnMultiply fn = JSBinary BitwiseOr (JSBinary Multiply x y) (JSNumericLiteral (Left 0))
102 | isDict semiringInt dict && isFn fnMultiply fn = JSBinary BitwiseOr (JSBinary Multiply x y) (JSNumericLiteral (Left 0))
@@ -108,7 +107,6 @@ inlineValues = everywhereOnJS convert
108 fnOne = (C.prelude, C.one)
107 fnOne = (C.prelude, C.one)
109 fnBottom = (C.prelude, C.bottom)
108 fnBottom = (C.prelude, C.bottom)
110 fnTop = (C.prelude, C.top)
109 fnTop = (C.prelude, C.top)
111− fromNumber = (C.dataInt, C.fromNumber)
112 fnAdd = (C.prelude, (C.+))
110 fnAdd = (C.prelude, (C.+))
113 fnDivide = (C.prelude, (C./))
111 fnDivide = (C.prelude, (C./))
114 fnMultiply = (C.prelude, (C.*))
112 fnMultiply = (C.prelude, (C.*))
src/Language/PureScript/Constants.hs−3
@@ -115,9 +115,6 @@ zshr = "zshr"
115complement :: String
115complement :: String
116complement = "complement"
116complement = "complement"
117
117
118−fromNumber :: String
119−fromNumber = "fromNumber"
120−
121-- Prelude Values
118-- Prelude Values
122
119
123zero :: String
120zero :: String