-- | Utility functions from older versions of @conduit@. These should be-- considered deprecated, as there are now easier ways to handle their use-- cases. This module is provided solely for backwards compatibility.moduleData.Conduit.Util(-- * Misczip,zipSinks)whereimportPreludehiding(zip)importControl.Monad(liftM,liftM2)importData.Conduit.Internal(Pipe(..),Source,Sink,injectLeftovers,ConduitM(..))importData.Void(Void,absurd)-- | Combines two sources. The new source will stop producing once either-- source has been exhausted.---- Since 0.3.0zip::Monadm=>Sourcema->Sourcemb->Sourcem(a,b)zip(ConduitMleft0)(ConduitMright0)=ConduitM$goleft0right0wherego(Leftoverleft())right=goleftrightgoleft(Leftoverright())=goleftrightgo(Done())(Done())=Done()go(Done())(HaveOutput_close_)=PipeM(close>>return(Done()))go(HaveOutput_close_)(Done())=PipeM(close>>return(Done()))go(Done())(PipeM_)=Done()go(PipeM_)(Done())=Done()go(PipeMmx)(PipeMmy)=PipeM(liftM2gomxmy)go(PipeMmx)y@HaveOutput{}=PipeM(liftM(\x->goxy)mx)gox@HaveOutput{}(PipeMmy)=PipeM(liftM(gox)my)go(HaveOutputsrcxclosexx)(HaveOutputsrcycloseyy)=HaveOutput(gosrcxsrcy)(closex>>closey)(x,y)go(NeedInput_c)right=go(c())rightgoleft(NeedInput_c)=goleft(c())-- | Combines two sinks. The new sink will complete when both input sinks have-- completed.---- Any leftovers are discarded.---- Since 0.4.1zipSinks::Monadm=>Sinkimr->Sinkimr'->Sinkim(r,r')zipSinks(ConduitMx0)(ConduitMy0)=ConduitM$injectLeftoversx0><injectLeftoversy0where(><)::Monadm=>PipeVoidiVoid()mr1->PipeVoidiVoid()mr2->Pipelio()m(r1,r2)Leftover_i><_=absurdi_><Leftover_i=absurdiHaveOutput__o><_=absurdo_><HaveOutput__o=absurdoPipeMmx><y=PipeM(liftM(><y)mx)x><PipeMmy=PipeM(liftM(x><)my)Donex><Doney=Done(x,y)NeedInputpxcx><NeedInputpycy=NeedInput(\i->pxi><pyi)(\()->cx()><cy())NeedInputpxcx><y@Done{}=NeedInput(\i->pxi><y)(\u->cxu><y)x@Done{}><NeedInputpycy=NeedInput(\i->x><pyi)(\u->x><cyu)