Proposal: overhaul System.Process
Don Stewart
dons at galois.com
Tue Apr 22 19:09:56 EDT 2008
duncan.coutts:
>
> On Tue, 2008-04-22 at 15:52 -0700, Don Stewart wrote:
> > duncan.coutts:
>
> > > > > I would have thought (ExitCode,String) was more appropriate.
> > > >
> > > > Yes, definitely.
> > >
> > > Yes, I mentioned this to Don previously when he published his popen
> > > code. I think he agreed.
>
> > I'd changed, but not pushed out, process-light:
>
> > readProcess :: FilePath -- ^ command to run
> > -> [String] -- ^ any arguments
> > -> String -- ^ standard input
> > -> IO (Either (ExitCode,String) String) -- ^ either the stdout, or an exitcode and any output
>
> You don't need the Either. ExitCode already covers the case when the
> process terminates successfully.
>
But we want to force people to check the failure case. Just returning
the tuple doesn't help there.
-- Don
More information about the Libraries
mailing list