There is no way to turn a `Producer -> Producer` into a `Pipe` in general.  
Usually the point of writing a function of type `Producer -> Producer` is so 
that you can detect and handle the end of input.  If your `compress` function 
is doing something similar then something like `for producer (compress . 
yield)` might misbehave because it will treat each value yielded by the 
`producer` as having its own end of input.

> On Apr 13, 2017, at 9:32 PM, Daniel Hill <[email protected]> wrote:
> 
> Hey guys,
> 
> the types of Pipes.Zlib/Gzip are in the form Producer -> Producer, if I was 
> to implement such a library my first though would be to make them Pipes, so 
> you could compose them as such ` producer >-> compress >-> consumer`.
> 
> instead i have to use the form `for producer (\x -> compress (yield x)) >-> 
> consumer` which works correctly for my current project, but I'm left 
> wondering why I have to perform such gymnastics to turn them in to pipes, 
> something tells me that i need  to use ~> but even if I can get it to 
> compile, I don't get any output.
> 
> So can anyone give me some insight to this, thanks
> 
> - Daniel
> 
> -- 
> 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] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.

-- 
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