2 % (c) The GRASP/AQUA Project, Glasgow University, 1998
4 \section[Bits]{The @Bits@ interface}
6 Defines the @Bits@ class containing bit-based operations.
7 See library document for details on the semantics of the
11 {-# OPTIONS -fno-implicit-prelude #-}
17 infixl 8 `shift`, `rotate`
23 (.&.), (.|.), xor :: a -> a -> a
25 shift :: a -> Int -> a
26 rotate :: a -> Int -> a
28 setBit :: a -> Int -> a
29 clearBit :: a -> Int -> a
30 complementBit :: a -> Int -> a
31 testBit :: a -> Int -> Bool
35 shiftL, shiftR :: Bits a => a -> Int -> a
36 rotateL, rotateR :: Bits a => a -> Int -> a
37 shiftL a i = shift a i
38 shiftR a i = shift a (-i)
39 rotateL a i = rotate a i
40 rotateR a i = rotate a (-i)