iteratee eneeCheckIfDone vs eneeCheckIfDonePass

John Lato jwlato at
Mon Nov 7 21:02:58 GMT 2011

I was originally against this as I consider it a partial solution,
however you've convinced me that the current behavior is broken and a
partial solution is better than no solution at all.

I've applied your patch, and also changed eneeCheckIfDone to use a
default eneeCheckIfDonePass implementation so that all the enee* logic
is only in the eneeCheckIfDoneHandle function.

This is on Hackage as iteratee- ( was an accidental
upload with only some of the changes applied).


On Fri, Nov 4, 2011 at 3:43 AM, Michael Baikov <manpacket at> wrote:
> Current version of eneeCheckIfDone and all Enumeratees (pretty much
> every Enumeratee in the library) which uses it are still broken.
> I think eneeCheckIfDone should be implemented in terms of
> eneeCheckIfDonePass, since eneeCheckIfDone  goes into infinite loop on
> every controll message it sees.
> Your reasoning about this behaviour was connected to the only control
> message you have in your library - seek.
> But suppose you are writing some software doing processing of
> multicast data (video player analogy). This means that you will have
> such control functions as
> subscribeMulticast :: String -> Iteratee s m ()
> unsubscribeMulticast :: String -> Iteratee s m ()
> Those messages should be passed unchanged to the underlying
> Enumerator. And to make them work properly currently you have to
> reimplement any Enumeratee which uses eneeCheckIfDone - basically
> every Enumeratee there is in the library (or create a local fork of
> the library with this bug fixed).
> Could you please consider this once more and release with
> eneeCheckIfDone replaced with checkIfDonePass? Since current
> implementation just loops forever on any control messages means that
> nobody actually passes any control messages through Enumeratees, which
> means no existing code behaviour will be changed. And of cause you can
> place a note about your concerns with seek function and different
> types of chunks in seek function implementation.
> Patch attached

More information about the Iteratee mailing list