In Haskell, it seems that bit-wise operations are typically handled via the Data.Bits module and the Bits class.
I'd like to perform bit-manipulations on ByteStrings of any length (eg set, clear, shift, masks...) but I cannot find an instance of Bits for ByteStrings anywhere.
My question: should I implement the instance myself (probably a good exercise)? If so is there any recommendation to get some "acceptable performance"? Or is it a bad idea to try to do bit-manipulations directly on ByteStrings, in which case what would be a better way?