From: simonmar Date: Tue, 31 Jul 2001 13:06:51 +0000 (+0000) Subject: [project @ 2001-07-31 13:06:51 by simonmar] X-Git-Tag: nhc98-1-18-release~1198 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=39ae4eafcd959ea69fd4a0435895d271b1217460;p=haskell-directory.git [project @ 2001-07-31 13:06:51 by simonmar] merge ghc/lib/std/PrelEnum.lhs rev. 1.14 --- diff --git a/GHC/Enum.lhs b/GHC/Enum.lhs index 7e59d98..1391b1f 100644 --- a/GHC/Enum.lhs +++ b/GHC/Enum.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: Enum.lhs,v 1.4 2001/07/04 11:29:26 simonmar Exp $ +% $Id: Enum.lhs,v 1.5 2001/07/31 13:06:51 simonmar Exp $ % % (c) The University of Glasgow, 1992-2000 % @@ -313,7 +313,7 @@ instance Enum Int where fromEnum x = x {-# INLINE enumFrom #-} - enumFrom (I# x) = eftInt x 2147483647# + enumFrom (I# x) = case maxInt of I# y -> eftInt x y -- Blarg: technically I guess enumFrom isn't strict! {-# INLINE enumFromTo #-} @@ -373,14 +373,14 @@ efdtIntList x1 x2 y lim = y -# delta efdIntFB c n x1 x2 - | delta >=# 0# = go_up_int_fb c n x1 delta ( 2147483647# -# delta) - | otherwise = go_dn_int_fb c n x1 delta ((-2147483648#) -# delta) + | delta >=# 0# = case maxInt of I# y -> go_up_int_fb c n x1 delta (y -# delta) + | otherwise = case minInt of I# y -> go_dn_int_fb c n x1 delta (y -# delta) where delta = x2 -# x1 efdIntList x1 x2 - | delta >=# 0# = go_up_int_list x1 delta ( 2147483647# -# delta) - | otherwise = go_dn_int_list x1 delta ((-2147483648#) -# delta) + | delta >=# 0# = case maxInt of I# y -> go_up_int_list x1 delta (y -# delta) + | otherwise = case minInt of I# y -> go_dn_int_list x1 delta (y -# delta) where delta = x2 -# x1