Add Logical Shift Operators
|Reported by:||Owned by:|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
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.