On 23/04/2008, John Meacham <john@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