On Wed, Aug 18, 2010 at 22:24, Michael Snoyman <
michael@snoyman.com> wrote:
> John,
> This package looks very promising. I used iteratee for the yaml package, but
> I had many of the concerns that you have mentioned below. Version 0.2 of
> persistent is going to have some form of an enumerator interface for getting
> the results of a query, and I eventually decided that iteratee was
> introducing too much complexity to be a good candidate. However, I was able
> to port the package[1] over to enumerator in about half an hour; I
> especially benefited from your example applications.
>
> The only concern that I had was the possible inefficiency of representing
> all chunks as a list. In the case of persistent, the enumerator will
> *always* generate a one-lengthed list, and the most common operation is
> selectList, which returns all results as a list. If I used your consume
> function, I believe there would be a *lot* of list traversals. Instead,
> selectList[2] uses ([a] -> [a]) for building up the result internally. I
> haven't really thought the issue through fully, so I can recommend anything
> better. Perhaps more importantly, the simplification introduced by just
> dealing with lists is well received.
> Keep up the good work, I look forward to seeing more about enumerator.
> Michael
> [1]
http://github.com/snoyberg/persistent/tree/enumerator
> [2]
http://github.com/snoyberg/persistent/blob/enumerator/Database/Persist/Base.hs#L322