-shiftL, shiftR :: Bits a => a -> Int -> a
-rotateL, rotateR :: Bits a => a -> Int -> a
-x `shiftL` i = x `shift` i
-x `shiftR` i = x `shift` (-i)
-x `rotateL` i = x `rotate` i
-x `rotateR` i = x `rotate` (-i)
+ An instance can define either this and 'shiftR' or the unified
+ 'shift', depending on which is more convenient for the type in
+ question. -}
+ shiftL :: a -> Int -> a
+ x `shiftL` i = x `shift` i
+
+ {-| Shift the first argument right by the specified number of bits
+ (which must be non-negative).
+ Right shifts perform sign extension on signed number types;
+ i.e. they fill the top bits with 1 if the @x@ is negative
+ and with 0 otherwise.
+
+ An instance can define either this and 'shiftL' or the unified
+ 'shift', depending on which is more convenient for the type in
+ question. -}
+ shiftR :: a -> Int -> a
+ x `shiftR` i = x `shift` (-i)
+
+ {-| Rotate the argument left by the specified number of bits
+ (which must be non-negative).
+
+ An instance can define either this and 'rotateR' or the unified
+ 'rotate', depending on which is more convenient for the type in
+ question. -}
+ rotateL :: a -> Int -> a
+ x `rotateL` i = x `rotate` i
+
+ {-| Rotate the argument right by the specified number of bits
+ (which must be non-negative).
+
+ An instance can define either this and 'rotateL' or the unified
+ 'rotate', depending on which is more convenient for the type in
+ question. -}
+ rotateR :: a -> Int -> a
+ x `rotateR` i = x `rotate` (-i)