I'm porting some imperative code to Haskell. My goal is to analyze an executable, therefore each byte of the text section gets assigned a number of flags, which would all fit in a byte (6 bits to be precise).
In a language like C, I would just allocate an array of bytes, zero them and update them as I go. How would I do this efficiently in Haskell?
In other words: I'm looking for a ByteString with bit-wise access and constant time updates as I disassemble more of the text section.
Edit: Of course, any kind of other data structure would do if it was similarly efficient.