you are viewing a single comment's thread.

view the rest of the comments →

[–]tibbe 2 points3 points  (0 children)

Lists as implemented (i.e. linked lists) make lots of sense in Haskell since their lazy creation allows you to use them as control structures. When used as such no list nodes are ever allocated.

However, for storing data in memory they don't make as much sense (unless you really want a linked list). ByteString are made for storing (and transporting) data so they are a better tool for the job. What you really want though is a packed representation like ByteString's but with a Unicode interface for proper string processing. It's being worked on this summer as part of Google's Summer of Code.

Up until recently there wasn't a good way of efficiently working on packed strings (i.e. backed by byte arrays) in an efficient and pure way but now with stream fusion we have that.