diff options
author | Ian Lynagh <igloo@earth.li> | 2011-07-22 19:09:46 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-07-22 19:09:46 +0100 |
commit | 1f9e4a30e86e21ad3d5231bdbeee86bad74c3fc7 (patch) | |
tree | 330d5d49008bbad8eedcaf3a58eadff3924c813f /libraries/integer-gmp/GHC/Integer.lhs | |
parent | ec1c486a36c23e8d3fb7b07fc3874c548589d253 (diff) | |
download | haskell-1f9e4a30e86e21ad3d5231bdbeee86bad74c3fc7.tar.gz |
Eq and Ord instances are now in the integer package, not base
Diffstat (limited to 'libraries/integer-gmp/GHC/Integer.lhs')
-rw-r--r-- | libraries/integer-gmp/GHC/Integer.lhs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libraries/integer-gmp/GHC/Integer.lhs b/libraries/integer-gmp/GHC/Integer.lhs index 4ca4cee3b8..fd911e07d8 100644 --- a/libraries/integer-gmp/GHC/Integer.lhs +++ b/libraries/integer-gmp/GHC/Integer.lhs @@ -85,6 +85,7 @@ import GHC.IntWord64 ( ) #endif +import GHC.Classes import GHC.Ordering import GHC.Types @@ -332,6 +333,10 @@ neqInteger (S# i) (J# s d) = cmpIntegerInt# s d i /=# 0# neqInteger (J# s d) (S# i) = cmpIntegerInt# s d i /=# 0# neqInteger (J# s1 d1) (J# s2 d2) = (cmpInteger# s1 d1 s2 d2) /=# 0# +instance Eq Integer where + (==) = eqInteger + (/=) = neqInteger + ------------------------------------------------------------------------ leInteger :: Integer -> Integer -> Bool @@ -378,6 +383,13 @@ compareInteger (J# s1 d1) (J# s2 d2) if res# <# 0# then LT else if res# ># 0# then GT else EQ } + +instance Ord Integer where + (<=) = leInteger + (>) = gtInteger + (<) = ltInteger + (>=) = geInteger + compare = compareInteger \end{code} |