@@ -111,6 +111,8 @@ inlineCommonValues = everywhereOnCpp convert
111111 | isDict' [semiringNumber, semiringInt] dict && isFn fnOne fn = CppNumericLiteral (Left 1)
112112 | isDict boundedBoolean dict && isFn fnBottom fn = CppBooleanLiteral False
113113 | isDict boundedBoolean dict && isFn fnTop fn = CppBooleanLiteral True
114+ convert (CppApp (CppApp fn [dict]) [x])
115+ | isDict ringInt dict && isFn fnNegate fn = CppUnary Negate x
114116 convert (CppApp fn [dict, x, y])
115117 | isDict semiringInt dict && isFn fnAdd fn = CppBinary Add x y
116118 | isDict semiringInt dict && isFn fnMultiply fn = CppBinary Multiply x y
@@ -130,6 +132,7 @@ inlineCommonValues = everywhereOnCpp convert
130132 fnDivide = (C.dataEuclideanRing, C.div)
131133 fnMultiply = (C.dataSemiring, C.mul)
132134 fnSubtract = (C.dataRing, C.sub)
135+ fnNegate = (C.dataRing, C.negate)
133136
134137inlineOperator :: (Text, Text) -> (Cpp -> Cpp -> Cpp) -> Cpp -> Cpp
135138inlineOperator (m, op) f = everywhereOnCpp convert
@@ -148,8 +151,6 @@ inlineCommonOperators = applyAll $
148151
149152 , binary ringNumber opSub Subtract
150153 , unary ringNumber opNegate Negate
151− , binary ringInt opSub Subtract
152− , unary ringInt opNegate Negate
153154
154155 , binary euclideanRingNumber opDiv Divide
155156 , binary euclideanRingInt opMod Modulus