[Haskell-beginners] merge two handles

Manfred Lotz manfred.lotz at arcor.de
Mon Jun 13 20:14:55 CEST 2011


On Mon, 13 Jun 2011 12:51:02 -0500
Antoine Latter <aslatter at gmail.com> wrote:

> On Mon, Jun 13, 2011 at 12:35 PM, Manfred Lotz
> <manfred.lotz at arcor.de> wrote:
> > Hi all,
> > I have two handles where I get stdout resp. stderr from a command
> > output.
> >
> >
> > Is it possible to merge those two handles so that I get a new input
> > handle in a way that data can be read from the new handle whenever
> > it is available from either of the two original handles?
> >
> >
> 
> Does what you're doing strictly need to be a handle?
> 
> One thing you could try is is using an IO Channel:
> http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Concurrent-Chan.html
> 

Hmm, not quite sure. I was asking about handles because I use:

(_ ,Just hout ,Just herr ,p) <- createProcess (proc cmd parms) {
    std_out = CreatePipe,
    std_err = CreatePipe
  }


which gives me handles to deal with.


-- 
Manfred









More information about the Beginners mailing list