| (.&.) :: a -> a -> a |
| Bitwise "and" |
|
| (.|.) :: a -> a -> a |
| Bitwise "or" |
|
| xor :: a -> a -> a |
| Bitwise "xor" |
|
| complement :: a -> a |
| Reverse all the bits in the argument |
|
| shift :: a -> Int -> a |
| Signed shift the argument left by the specified number of bits.
Right shifts are specified by giving a negative value. |
|
| rotate :: a -> Int -> a |
Signed rotate the argument left by the specified number of bits.
Right rotates are specified by giving a negative value. rotate is well defined only if bitSize is also well defined
(bitSize is undefined for Integer, for example).
|
|
| bit :: Int -> a |
| bit i is a value with the ith bit set |
|
| setBit :: a -> Int -> a |
| x `setBit` i is the same as x .|. bit i |
|
| clearBit :: a -> Int -> a |
| x `clearBit` i is the same as x .&. complement (bit i) |
|
| complementBit :: a -> Int -> a |
| x `complementBit` i is the same as x `xor` bit i |
|
| testBit :: a -> Int -> Bool |
| Return True if the nth bit of the argument is 1 |
|
| bitSize :: a -> Int |
| Return the number of bits in the type of the argument. The actual
value of the argument is ignored |
|
| isSigned :: a -> Bool |
| Return True if the argument is a signed type. The actual
value of the argument is ignored |