Sorry for the repeat postings. My machine freaked out
> From: [email protected] > Date: Mon, 5 Mar 2012 16:56:11 +0200 > Subject: Re: [Haskell-cafe] Conduit Sink fork > To: [email protected] > CC: [email protected] > > On Mon, Mar 5, 2012 at 1:54 AM, t helfferich <[email protected]> wrote: > > Hi! > > So, it turns out I have a need for a sink that forks input into two other > > sinks using the Conduit package. Here is what I came up > > with: https://gist.github.com/1975383 > > > > Is this the right way to write it? Also, what left over value(s) should I > > return in the Done constructor? > > > > I appreciate any help you can give me. > > > > Thanks so much, > > Grant > > > > _______________________________________________ > > Haskell-Cafe mailing list > > [email protected] > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > It looks like the right approach to me. What to do with the leftover > values is a really good question, and I don't think there's really an > obvious answer. I can think of a few approaches: > > * What you've done: never return leftover values. > * Always return the ll (or rr). > * Return whichever leftover value is Just, or if both are Just, > arbitrarily choosing one of them > > Similarly, you could take different approaches to what to do when > processing terminates early: > > * What you've done: continue pushing data until both Sinks return Done > * Terminate whenever the left (or right) Sink returns Done > * Terminate when *either* returns Done > > Again, there's no right answer here, they all seem like valid approaches. > > Michael
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
