summaryrefslogtreecommitdiff
path: root/libraries/ghc-bignum
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-09-30 19:26:02 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-01 18:38:35 -0400
commite5523324d2c55e0091857e21bf5613b5f6b442a7 (patch)
treeca024915a9380f820d4f30419666e156c1109742 /libraries/ghc-bignum
parenta8018c17747342444c67eeec21a506c89c1110e8 (diff)
downloadhaskell-e5523324d2c55e0091857e21bf5613b5f6b442a7.tar.gz
Bignum: add integerNegate RULE
Diffstat (limited to 'libraries/ghc-bignum')
-rw-r--r--libraries/ghc-bignum/src/GHC/Num/Integer.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/libraries/ghc-bignum/src/GHC/Num/Integer.hs b/libraries/ghc-bignum/src/GHC/Num/Integer.hs
index 43e4a18cdd..daa7ab8388 100644
--- a/libraries/ghc-bignum/src/GHC/Num/Integer.hs
+++ b/libraries/ghc-bignum/src/GHC/Num/Integer.hs
@@ -486,6 +486,9 @@ integerNegate (IP b)
| isTrue# (bigNatEqWord# b ABS_INT_MINBOUND##) = IS INT_MINBOUND#
| True = IN b
+{-# RULES
+"integerNegate/integerNegate" forall x. integerNegate (integerNegate x) = x
+#-}
-- | Compute absolute value of an 'Integer'
integerAbs :: Integer -> Integer