[darcs-users] darcs patch: resolve issue784: fix file handle leak and check for exceptions on process running.

Salvatore Insalaco kirby81 at gmail.com
Mon Oct 20 06:51:46 UTC 2008


2008/10/20 Jason Dagit <dagit at codersbase.com>:
> So it looks like you made this changes:
> +ortryrunning :: IO ExitCode -> IO ExitCode -> IO ExitCode
> +a `ortryrunning` b = do ret <- try a
> +                        case ret of
> +                          (Right ExitSuccess) -> return ExitSuccess
> +                          _ -> b
>
> Just checking that I understand, this could also be:
> a `ortryrunning` b = try a >>= either (const b) return

Unfortunately that's not the same. We should return ExitSuccess only
when we got the ExitSuccess return code, not on any return code that
is not an exception.

Salvatore


More information about the darcs-users mailing list