> I send request via stdin and I get the response via stdout. 

When reading stdout, what should count as a "complete response", so that 
the next request can be emitted to stdin? Is every response is just a 
single line of text, or can they be multiline?

On Wednesday, October 7, 2015 at 11:05:48 PM UTC+2, Andrea Corradi wrote:
>
> Hi all, 
>
> I want to interact with a process through its stdin/stdout; 
> the interaction is similar to the one with a server where 
> I send request via stdin and I get the response via stdout. 
>
> For this reason I was trying to use a producer and a consumer 
> to make a Server and compose it with a Client using +>> 
>
> Function that should make a Server: 
>
> serverProcess toPipe fromPipe input = do 
> (yield input >~ return ExitSuccess) >-> toPipe 
> r <- next fromPipe 
> case r of 
>   Left e -> return e 
>   Right (output,fromPipe') -> 
>     do input' <- respond output 
>        serverProcess toPipe fromPipe' input' 
>
> This function has type 
> serverProcess :: Monad m => 
>   Proxy () b1 b1 c m ExitCode 
>   -> Producer c (Proxy a' a b1 c m) b -> b1 -> Proxy a' a b1 c m b 
>
> and is not usable as I wanted. Unfortunately I could not come up with 
> a solution. 
>
> I'm using pipes-cliff to open the process and get the Producer 
> and Consumer pipes. 
>
>
> Is there a way to make this work? 
> Is there a more idiomatic way to do this? 
>
> Thanks, 
> Andrea 
>

-- 
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 haskell-pipes+unsubscr...@googlegroups.com.
To post to this group, send email to haskell-pipes@googlegroups.com.

Reply via email to