Add Logical Shift Operators
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.
Trac metadata
Trac field | Value |
---|---|
Version | 6.6 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |