@@ -334,17 +334,7 @@ newFoldSVar stt f = do
334 -- Add the producer thread-id to the SVar.
334 -- Add the producer thread-id to the SVar.
335 liftIO myThreadId >>= modifyThread sv
335 liftIO myThreadId >>= modifyThread sv
337− -- XXX move this in fromProducer itself.
339− -- A wrapper to send a Stop event back to the producer when the fold
340− -- receives a stop from the producer.
341− let pull m = mkStream $ \st yld _ stp -> do
342− let stop = sendStopToProducer sv >> stp
343− single a = yld a (K.nilM (sendStopToProducer sv))
344− yieldk a r = yld a (pull r)
345− in foldStreamShared st yieldk single stop m
347− void $ doFork (void $ f $ fromStream $ pull $ fromProducer sv)
337+ void $ doFork (void $ f $ fromStream $ fromProducer sv)
348 (svarMrun sv)
338 (svarMrun sv)
349 (handleFoldException sv)
339 (handleFoldException sv)
350 return sv
340 return sv