minInt = I# (-0x8000000000000000#)
maxInt = I# 0x7FFFFFFFFFFFFFFF#
#endif
-
-instance Eq Int where
- (==) = eqInt
- (/=) = neInt
-
-instance Ord Int where
- compare = compareInt
- (<) = ltInt
- (<=) = leInt
- (>=) = geInt
- (>) = gtInt
-
-compareInt :: Int -> Int -> Ordering
-(I# x#) `compareInt` (I# y#) = compareInt# x# y#
-
-compareInt# :: Int# -> Int# -> Ordering
-compareInt# x# y#
- | x# <# y# = LT
- | x# ==# y# = EQ
- | otherwise = GT
\end{code}
used in the case of partial applications, etc.
\begin{code}
-{-# INLINE eqInt #-}
-{-# INLINE neInt #-}
-{-# INLINE gtInt #-}
-{-# INLINE geInt #-}
-{-# INLINE ltInt #-}
-{-# INLINE leInt #-}
{-# INLINE plusInt #-}
{-# INLINE minusInt #-}
{-# INLINE timesInt #-}
negateInt :: Int -> Int
negateInt (I# x) = I# (negateInt# x)
-gtInt, geInt, eqInt, neInt, ltInt, leInt :: Int -> Int -> Bool
-(I# x) `gtInt` (I# y) = x ># y
-(I# x) `geInt` (I# y) = x >=# y
-(I# x) `eqInt` (I# y) = x ==# y
-(I# x) `neInt` (I# y) = x /=# y
-(I# x) `ltInt` (I# y) = x <# y
-(I# x) `leInt` (I# y) = x <=# y
-
{-# RULES
"x# ># x#" forall x#. x# ># x# = False
"x# >=# x#" forall x#. x# >=# x# = True
"plusFloat x 0.0" forall x#. plusFloat# x# 0.0# = x#
"plusFloat 0.0 x" forall x#. plusFloat# 0.0# x# = x#
"minusFloat x 0.0" forall x#. minusFloat# x# 0.0# = x#
-"minusFloat x x" forall x#. minusFloat# x# x# = 0.0#
-"timesFloat x 0.0" forall x#. timesFloat# x# 0.0# = 0.0#
-"timesFloat0.0 x" forall x#. timesFloat# 0.0# x# = 0.0#
"timesFloat x 1.0" forall x#. timesFloat# x# 1.0# = x#
"timesFloat 1.0 x" forall x#. timesFloat# 1.0# x# = x#
"divideFloat x 1.0" forall x#. divideFloat# x# 1.0# = x#
"timesDouble x 0.0" forall x#. (*##) x# 0.0## = 0.0##
These are tested by num014.
+
+Similarly for Float (#5178):
+
+"minusFloat x x" forall x#. minusFloat# x# x# = 0.0#
+"timesFloat0.0 x" forall x#. timesFloat# 0.0# x# = 0.0#
+"timesFloat x 0.0" forall x#. timesFloat# x# 0.0# = 0.0#
-}
-- Wrappers for the shift operations. The uncheckedShift# family are