<p dir="ltr"><br>
On Mar 10, 2014 1:54 PM, "Johan Tibell" <<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>> wrote:<br>
><br>
> On Mon, Mar 10, 2014 at 1:47 PM, Ian Lynagh <<a href="mailto:igloo@earth.li">igloo@earth.li</a>> wrote:<br>
>><br>
>> On Mon, Mar 10, 2014 at 02:32:06PM +0200, Michael Snoyman wrote:<br>
>> > On Mon, Mar 10, 2014 at 2:30 PM, Johan Tibell <<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>>wrote:<br>
>> ><br>
>> > > I propose we add it to System.IO. Note that we'd have to copy the 5 lines<br>
>> > > in System.Posix.IO.createPipe into base as the above implementation would<br>
>> > > otherwise depend on the unix package.<br>
>> > ><br>
>> > +1. I've needed this in the past when working with process, and ended up<br>
>> > writing POSIX-only code as a result.<br>
>><br>
>> Would it make more sense to put it in process, and thus avoid needing to<br>
>> copy/move code into base?<br>
><br>
><br>
> I'm certainly open to that idea. If the only uses of pipes are for processes, I think that makes sense. Are there any typical non-process uses of pipes? I can't think of any right now.</p>
<p dir="ltr">Yes: transferring data from one socket to another in a zero-copy fashion using the 'splice' syscall in Linux requires passing stuff through a pipe (used as a buffer).<br>
I for one wouldn't consider a dependency on 'process' to write such code (if I ever would in Haskell...) to be a problem though.</p>
<p dir="ltr">Nicolas</p>