
Hi, I have written a small "wrapper" to speed random-access to a list. The usage scenario I have in mind is a "stream" computation yielding an infinite list, and I want to randomly access elements w/o having to traverse the entire list from the beginning for each access. I suspected something similar must already exist, but nothing I looked at seemed to do the trick. IntMap seems to want a finite input list. Ditto for the various array types, except possibly dynamic array. Attached is the list indexer I came up with, and a small test program (I swap the commented-out lines to switch btw. list & list index tests). I am interested to hear any feedback on this -- whether it duplicates something that already exists, or whether there's a better approach, and comments on the code, etc. Also if somebody can suggest a better name (so as not to overlay the word index too much.) I'll publish it on hackage (or at least github) if people think it's useful. It sped up the program I initally wrote it for enormously. Thanks, Alex