Proposal: overhaul System.Process

Simon Marlow marlowsd at gmail.com
Thu Apr 24 12:11:23 EDT 2008


On 23/04/2008, John Meacham <john at repetae.net> wrote:
>
> On Wed, Apr 23, 2008 at 11:29:42AM -0700, Simon Marlow wrote:
>
> > Ok, here's the new proposal.
> >
> > readProcess
> >     :: FilePath                 -- ^ command to run
> >     -> [String]                 -- ^ any arguments
> >     -> String                   -- ^ standard input
> >     -> IO String                -- ^ stdout + stderr
> >
> > readProcessMayFail
> >     :: FilePath                 -- ^ command to run
> >     -> [String]                 -- ^ any arguments
> >     -> String                   -- ^ standard input
> >     -> IO (ExitCode,String)     -- ^ exitcode, and stdout + stderr
>
>
> MayFail seems to be attached to the wrong one here. 'readProcess' is the
> one that might fail, the second actual call always succeeds but returns an
> error code. I think readProcessWithExitCode is better.


yes, well the idea was that you would use readProcessMayFail when you are
anticipating that the process might fail.  Still, I like your suggestion of
readProcessWithExitCode better, so I'll go with that.

Cheers,
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20080424/54b600e1/attachment.htm


More information about the Libraries mailing list