<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 10, 2014 at 8:54 AM, Johan Tibell <span dir="ltr"><<a href="mailto:johan.tibell@gmail.com" target="_blank">johan.tibell@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="">On Mon, Mar 10, 2014 at 1:47 PM, Ian Lynagh <span dir="ltr"><<a href="mailto:igloo@earth.li" target="_blank">igloo@earth.li</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>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" target="_blank">johan.tibell@gmail.com</a>>wrote:<br>
</div><div>> > 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>
</div><div>> +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>
</div>Would it make more sense to put it in process, and thus avoid needing to<br>
copy/move code into base?<br></blockquote><div><br></div></div><div>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.</div>
</div></div></div></blockquote></div><div class="gmail_extra"><br></div>I know of one in C, and it seems potentially applicable to Haskell as well, but it's mostly(?) a Unix-ism: you allocate a pipe, write to it in a signal handler, and monitor the read end in an event loop (in Haskell, a thread) in order to change an asynchronous signal that may have happened when it's unsafe to e.g. allocate memory into a synchronous event that can be handled safely. Note that you must use an unbuffered write from <a href="http://System.Posix.IO">System.Posix.IO</a> to write from the signal handler safely, so this introduces a hard dependency on the `unix` package; although there may be a win32 equivalent.<br clear="all">
<div><br></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div>
<div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div>