Safe Haskell | Safe |
---|

Bitwise operators.

# Documentation

The `Bits`

class defines bitwise operations over integral types.

- Bits are numbered from 0 with bit 0 being the least significant bit.

Minimal complete definition: `.&.`

, `.|.`

, `xor`

, `complement`

,
(`shift`

or (`shiftL`

and `shiftR`

)), (`rotate`

or (`rotateL`

and `rotateR`

)),
`bitSize`

, `isSigned`

, `testBit`

, `bit`

, and `popCount`

. The latter three can
be implemented using `testBitDefault`

, 'bitDefault, and `popCountDefault`

, if
`a`

is also an instance of `Num`

.

(.&.) :: a -> a -> a

Bitwise "and"

(.|.) :: a -> a -> a

Bitwise "or"

complement :: a -> a

Reverse all the bits in the argument