Proposal: add createPipe to base

Nicolas Trangez nicolas at incubaid.com
Mon Mar 10 19:41:23 UTC 2014


On Mar 10, 2014 1:54 PM, "Johan Tibell" <johan.tibell at gmail.com> wrote:
>
> On Mon, Mar 10, 2014 at 1:47 PM, Ian Lynagh <igloo at earth.li> wrote:
>>
>> On Mon, Mar 10, 2014 at 02:32:06PM +0200, Michael Snoyman wrote:
>> > On Mon, Mar 10, 2014 at 2:30 PM, Johan Tibell <johan.tibell at gmail.com
>wrote:
>> >
>> > > I propose we add it to System.IO. Note that we'd have to copy the 5
lines
>> > > in System.Posix.IO.createPipe into base as the above implementation
would
>> > > otherwise depend on the unix package.
>> > >
>> > +1. I've needed this in the past when working with process, and ended
up
>> > writing POSIX-only code as a result.
>>
>> Would it make more sense to put it in process, and thus avoid needing to
>> copy/move code into base?
>
>
> 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.

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

Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140310/44fb6d73/attachment.html>


More information about the Libraries mailing list