[darcs-devel] [issue323] darcs dist support for tarballs in other
directories
Wim Lewis
wiml at hhhh.org
Sun Oct 29 18:13:27 PST 2006
On Oct 28, 2006, at 11:05 PM, Eric Y. Kow wrote:
> On Wed, Oct 25, 2006 at 21:37:26 -0700, Wim Lewis wrote:
>> resultfile <- return (formerdir++"/"++distname++".tar.gz")
>
> This could be better expressed as
> let resultfile = formerdir++"/"++distname++".tar.gz"
>
> To indicate that it's not got any monadic bits in it.
Aha, I didn't know the 'do' syntax would allow 'let' blocks like
that. Yes, that's much nicer. (Though I find that the 'return' is a
pretty good indicator that something non-monadic is happening in the
monad also.)
I decided to take a stab at adding error checking to the exec calls
in 'Dist', but I have a question: when a subprocess fails (exits
nonzero), would it be better to raise an ExecException, or to raise
an ioError? Since we're in the IO monad, an ioError of some sort
(probably userError) seems like the right way to signal a failure,
but on the other hand ExecException exists and has places to store
the information about the failed command. It doesn't look like
there's a way to make ExecException into an instance of IOError, is
there?
More information about the darcs-devel
mailing list