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 <mich...@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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to