Never mind, this was a stupid question. I can just make a consumer that 
ignores Left values and then write another pipe that ignores all Right 
values.

Regards, klrr

On Thursday, March 20, 2014 5:19:56 PM UTC+1, Karl-Oskar Rikås wrote:
>
> Okey, writing some pipes code I ended up writing a function that takes two 
> producers and turn them into one.
>
> ```
> merge :: Producer a m r -> Producer a m r -> Producer (Either a a) m ()
> merge pL pR = do
>   (output, input) <- lift $ spawn Unbounded
>   lift . forkIO $ do runEffect $ pL >-> P.map Left >-> toOutput output
>                      performGC
>   lift . forkIO $ do runEffect $ pR >-> P.map Right >-> toOutput output
>                      performGC
>   fromInput input
>
> ```
>
> Now I also need something like Pipes.Prelude.tee but that only consumes 
> Left values and forward Right values without consuming them, looking at the 
> source of tee I got quite confused. Has anybody written such function or 
> could help me implement it?
>
> Regards, klrr
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haskell Pipes" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to