[Haskell-cafe] Decorating exceptions with backtrace information

Ben Franksen ben.franksen at online.de
Wed May 13 13:52:18 UTC 2020

Am 12.05.20 um 23:06 schrieb Henning Thielemann:
> Thus the type should be:
> openFile ::
>    (AlreadyInUseException e,
>     DoesNotExistException e,
>     PermissionException e) =>
>    FilePath -> IOMode -> ExceptT e IO Handle

Yes, but then these errors would no longer be exceptions but normal
return values (if you remove the ExceptT veneer). So what you say
amounts to "exceptions should be removed from Haskell except for
programming errors". I agree that communicating IO errors (and similar
things) explicitly ie. via return value is the better choice.

But the proposal is about Haskell (the language and standard libraries)
as it presently is i.e. the one that uses exceptions for IO errors, not
the one you want to have and in which IO errors are communicated as
return values and openFile would have the type above. And that means
your objection to the proposal at hand is irrelevant and beside the point.

More information about the Haskell-Cafe mailing list