@@ -91,12 +91,15 @@ inlineValues = everywhereOnJS convert
91 | isDict boundedBoolean dict && isFn fnBottom fn = JSBooleanLiteral False
91 | isDict boundedBoolean dict && isFn fnBottom fn = JSBooleanLiteral False
92 | isDict boundedBoolean dict && isFn fnTop fn = JSBooleanLiteral True
92 | isDict boundedBoolean dict && isFn fnTop fn = JSBooleanLiteral True
93 convert (JSApp fn [value]) | isFn fromNumber fn = JSBinary BitwiseOr value (JSNumericLiteral (Left 0))
93 convert (JSApp fn [value]) | isFn fromNumber fn = JSBinary BitwiseOr value (JSNumericLiteral (Left 0))
94+ convert (JSApp (JSApp (JSApp fn [dict]) [x]) [y])
95+ | isDict moduloSemiringInt dict && isFn fnDivide fn = JSBinary BitwiseOr (JSBinary Divide x y) (JSNumericLiteral (Left 0))
94 convert other = other
96 convert other = other
95 fnZero = (C.prelude, C.zero)
97 fnZero = (C.prelude, C.zero)
96 fnOne = (C.prelude, C.one)
98 fnOne = (C.prelude, C.one)
97 fnBottom = (C.prelude, C.bottom)
99 fnBottom = (C.prelude, C.bottom)
98 fnTop = (C.prelude, C.top)
100 fnTop = (C.prelude, C.top)
99 fromNumber = (C.dataInt, C.fromNumber)
101 fromNumber = (C.dataInt, C.fromNumber)
102+ fnDivide = (C.prelude, (C./))
101inlineOperator :: (String, String) -> (JS -> JS -> JS) -> JS -> JS
104inlineOperator :: (String, String) -> (JS -> JS -> JS) -> JS -> JS
102inlineOperator (m, op) f = everywhereOnJS convert
105inlineOperator (m, op) f = everywhereOnJS convert
@@ -252,6 +255,9 @@ ringInt = (C.dataInt, C.ringInt)
252moduloSemiringNumber :: (String, String)
255moduloSemiringNumber :: (String, String)
253moduloSemiringNumber = (C.prelude, C.moduloSemiringNumber)
256moduloSemiringNumber = (C.prelude, C.moduloSemiringNumber)
258+moduloSemiringInt :: (String, String)
259+moduloSemiringInt = (C.dataInt, C.moduloSemiringInt)
255eqNumber :: (String, String)
261eqNumber :: (String, String)
256eqNumber = (C.prelude, C.eqNumber)
262eqNumber = (C.prelude, C.eqNumber)