X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Flib%2Fstd%2FPrelEnum.lhs;h=c0874a3009a8e3e6ebf16be54a8d31f2d666ad71;hb=d888cbcbaa3b4113fca39b9a0888b404ed8ec9b8;hp=0104e46f9b1887fbfd98785b23e288398280b7f9;hpb=f67093863e39083d979df087b3c1e358f5829b9c;p=ghc-hetmet.git diff --git a/ghc/lib/std/PrelEnum.lhs b/ghc/lib/std/PrelEnum.lhs index 0104e46..c0874a3 100644 --- a/ghc/lib/std/PrelEnum.lhs +++ b/ghc/lib/std/PrelEnum.lhs @@ -1,5 +1,5 @@ % ----------------------------------------------------------------------------- -% $Id: PrelEnum.lhs,v 1.13 2001/02/18 14:45:15 qrczak Exp $ +% $Id: PrelEnum.lhs,v 1.14 2001/07/24 06:31:35 ken Exp $ % % (c) The University of Glasgow, 1992-2000 % @@ -314,7 +314,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 #-} @@ -374,14 +374,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