[Haskell-cafe] ANNOUNCE: enumerator,
an alternative iteratee package
John Millikin
jmillikin at gmail.com
Thu Aug 19 13:01:14 EDT 2010
Ah, I missed that sentence. You're correct, a version of consume based
on CPS would probably perform better than Oleg's implementation.
I'll cut a new release later today, or tomorrow, which will include
your implementation.
On Wed, Aug 18, 2010 at 22:48, Michael Snoyman <michael at snoyman.com> wrote:
> I'd mentioned in my previous email that I was concerned that "consume" would
> traverse the entire list for each new record pulled from the database. I'll
> try to start using the combinators instead; do get started with, it was
> easier to just use the raw datatypes to more easily see what was happening.
> Would this version of consume perhaps be better:
> consume :: Monad m => Iteratee e a m [a]
> consume = liftI $ step id where
> step acc chunk =
> case chunk of
> Chunks [] -> Continue $ returnI . step acc
> Chunks xs -> Continue $ returnI . (step $ acc . (xs ++))
> EOF -> Yield (acc []) EOF
> Michael
More information about the Haskell-Cafe
mailing list