[Haskell-cafe] Library function for map+append

Luke Palmer lrpalmer at gmail.com
Tue Aug 18 12:51:44 EDT 2009

2009/8/18 Dusan Kolar <kolar at fit.vutbr.cz>:
> Dlists maybe good it all the app is written using them. Probably not good
> idea to switch to them in the middle of project...

I have a different criterion for DLists.  I think they are best to use
in small scopes (I think the same of monads), as opposed to
interfacing between different parts of a project.

A DList is well-suited when you are *outputting* a list using appends;
i.e. just concatenating stuff together, but not looking at the heads
or iterating over the lists.  The DList Quicksort is a perfect
example.   It also makes a good monoid for Writer.

toList it after you're done generating; this is an efficient operation.


More information about the Haskell-Cafe mailing list