Proposal: overhaul System.Process

Neil Mitchell ndmitchell at
Tue Apr 22 18:29:21 EDT 2008


> I've made some improvements to System.Process that I'd like to get feedback
> on.

It looks a lot nicer! I may be able to stop my standard trick of
system "cmd > stdout.txt 2> stderr.txt" then readFile.

The only function I was a bit concerned with was readProcess:

readProcess :: FilePath	-> [String] -> String -> IO (Either ExitCode String)

I would have thought (ExitCode,String) was more appropriate. This
interface means that readProcess cannot be lazy, as it must have the
ExitCode before it generates the Right. Additionally, its probably
quite important to have the output if something fails. I'd also like
clarification if the result string is the stdout handle, or both
stdout and stderr - I can see arguments for both variants, so perhaps
both could be provided?



More information about the Libraries mailing list