[darcs-devel] [patch1791] fix several uses of error where it shoul... (and 7 more)

Ganesh Sittampalam ganesh at earth.li
Wed Jan 23 18:37:00 UTC 2019


On 23/01/2019 17:26, Ben Franksen wrote:
> 
> Ben Franksen <ben.franksen at online.de> added the comment:
> 
> The upshot of all this is: when we call 'fail' in the IO Monad, this
> will be treated as "normal" failure, whereas a direct call to 'error' is
> treated as a bug. If we want to signal a "normal" failure from pure code
> we define a special Exception type and raise that.

This convention would mean that a pattern-match failure in the IO monad
will be treated as a "normal" failure. Does that matter?

FWIW I found and fixed (i.e. replaced with error) some cases of
potential pattern-match failure in polymorphic monadic code when dealing
with MonadFail, but I don't think we'd ever actually hit any of them in
practice.

Cheers,

Ganesh


More information about the darcs-devel mailing list