iteratee sequence_ runs a part of an twice

Akio Takano tkn.akio at
Fri Dec 9 01:50:53 GMT 2011


The following program should print "4 5", but it prints "4 5 5".

import Control.Monad.Trans
import Data.Iteratee
import qualified Data.Iteratee.ListLike as I

iter = do
    x <- I.head
    liftIO $ print x
    y <- I.head
    liftIO $ print y

main = enumList [[4],[5::Int]] (I.sequence_ [iter]) >>= run

I attached a proposed patch to fix the problem.

Takano Akio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sequence_.dpatch
Type: application/octet-stream
Size: 11119 bytes
Desc: not available
URL: <>

More information about the Iteratee mailing list