[GHC] #1005: Add Logical Shift Operators

GHC trac at galois.com
Thu Nov 16 01:50:14 EST 2006


#1005: Add Logical Shift Operators
-------------------------------+--------------------------------------------
    Reporter:  rob at mits.coop   |       Owner:         
        Type:  proposal        |      Status:  new    
    Priority:  normal          |   Milestone:         
   Component:  libraries/base  |     Version:  6.6    
    Severity:  normal          |    Keywords:         
  Difficulty:  Unknown         |    Testcase:         
Architecture:  Unknown         |          Os:  Unknown
-------------------------------+--------------------------------------------
This patch adds logical shift operators to complement the current
 arithmetic shift operators in Data.Bits.

 The patch has been tested against GHC on Linux running on Intel 32bit
 architecture. I haven't had an opportunity to test other architectures but
 they should work fine.

 The patch shouldn't break NHC or Hugs but I haven't been able to test them
 either. As it currently is, among the Int family, logical shift operators
 should work on these platforms for Int only. the Int* family of sized
 integers will currently treat logical shift operators as arithmetic shift
 operators as I couldn't figure out how to patch these.

 Integer will raise an error if a logical right-shift operator is attempted
 since it doesn't seem to make any sense for this type.

 By default, the logical shift operators will act as arithmetic shift
 operators and so should require no method definition for unsigned types.

 The patch also includes quickcheck properties which I've taken the liberty
 of creating a Tests directory for. I thought it would make sense to keep
 quickcheck properties with the library they belong to for easier
 management.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1005>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list