4

I'm looking for a data structure that stores bytes, allows constant-time pure indexing, and presents a pure, persistent interface for updating. Basically, I'm looking for Idris's equivalent of Haskell (strict) bytestrings.

Data.ByteArray provides a mutable byte array that is accessible from IO only; and it builds Data.Bytes on top of that which at first glance seems promising; however, it doesn't seem to have an indexing operation, and updating seems to only be possible by splitting and re-concatenating.

Cactus
  • 27,075
  • 9
  • 69
  • 149

0 Answers0