I'm not sure if I underestimate the power of MArray or not, but for the many algorithms that I implement, all I care about is that I have some kind of data structure for storing key / value pairs. Obviously, choosing a data structure will affect performance, but it would be nice to just write an algorithm and work on optimizing the data structure as needed.
I would really like, for example, the style:
class Monad m => MStore mkv where putAt :: k -> v -> m () getAt :: k -> mv -- and possibly pairs :: m [(k,v)]
Thus, my algorithm can manipulate things like k without worrying if it is Text , and I need to use a hash table or generalize and skip optimization of the Int key array.
source share