From: Ian Lynagh Date: Tue, 21 Jul 2009 22:24:40 +0000 (+0000) Subject: Use shift[LR]Integer in the Bits Integer instance X-Git-Tag: ghc-darcs-git-switchover~341 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=bb1ac04ed36183ed0234b207d27283253275f62e;p=ghc-base.git Use shift[LR]Integer in the Bits Integer instance --- diff --git a/Data/Bits.hs b/Data/Bits.hs index 46f009a..9b31397 100644 --- a/Data/Bits.hs +++ b/Data/Bits.hs @@ -48,7 +48,6 @@ module Data.Bits ( #ifdef __GLASGOW_HASKELL__ import GHC.Num -import GHC.Real import GHC.Base #endif @@ -292,8 +291,8 @@ instance Bits Integer where complement a = -1 - a #endif - shift x i | i >= 0 = x * 2^i - | otherwise = x `div` 2^(-i) + shift x i@(I# i#) | i >= 0 = shiftLInteger x i# + | otherwise = shiftRInteger x (negateInt# i#) rotate x i = shift x i -- since an Integer never wraps around