[Haskell-beginners] Printing the entries of a Data.Map m

Matthias Guedemann Matthias.Guedemann at ovgu.de
Sun May 15 15:48:49 CEST 2011


Hi Daniel,

> However, traverse assembles a new Map. While it's trivial to discard 
> consumed list-cells (if the list is consumed sequentially), that is not so 
> for Maps. Unless the compiler manages to completely eliminate the new Map, 
> that is going to cost considerably more than the throwaway list-cells.

good to know.

> I conclude that the new Map assembled by traverse is not discarded.
> So, overall, going through the list is better.

Ok, now if I think about it, this seems obvious :-) 
Thanks for the clarification and the tests.

regards
Matthias





More information about the Beginners mailing list