I am porting some imperative code to Haskell. My goal is to analyze the executable file, so each byte of the text section is assigned several flags that will all fit into bytes (more precisely, 6 bits).
In a language like C, I would just allocate an array of bytes, nullify them, and update when I go. How can I do this efficiently in Haskell?
In other words: I'm looking for a ByteString with bit access and constant time updates when I parse more of a text section.
Edit: Of course, any other data structure would work if it were just as efficient.
source share