[darcs-devel] [patch2017] support ghc-8.8 and ghc-8.10

Ganesh Sittampalam bugs at darcs.net
Sat Jul 25 22:41:45 UTC 2020


Ganesh Sittampalam <ganesh at earth.li> added the comment:

> The idea here was to make the minimally invasive changes that kept the
> behavior the same it was before, across different compiler/base-library
> versions. The instance MonadFail IO throws a UserError and i believe
> most monad transformers just lifted the fail method. The monads in this
> case are Apply and TreeMonad, for which instances in Darcs proper (i.e.
> outside of the test harness) are usually based on IO. The replacement
> 'throw . userError' is the closest approximation to the IO monad's
> 'fail' that I could think of.
> 
> Note that UserError is an IOException, which means that if code at lower
> levels (like apply) throws a UserError, we can (and in some places do)
> catch it, along with any other IOExceptions. If we do not catch them, it
> is is a normal user error.
> 
> Throwing UserErrors in the instances of Apply and TreeMonad is not
> ideal. This should be reviewed but that is pretty much out of scope for
> this patch bundle.

Thanks for the explanation. As you say with the immediate upgrade
problem fixed we can think about improving the overall situation in future.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch2017>
__________________________________


More information about the darcs-devel mailing list