Proposal: Extensible exceptions

Henning Thielemann lemming at henning-thielemann.de
Mon Jul 7 09:56:49 EDT 2008


On Mon, 7 Jul 2008, Daniel Yokomizo wrote:

> Exceptions as part of the types are a good idea but can become problematic:
>
> (.) :: (b -> c throws x) -> (a -> b throws y) -> (a -> c throws x + y)

You mean (Control.Arrow.<<<) ? :-)

> This kind of signature is the only correct way to express this without
> losing information, but it requires some way to encode the typed union
> without creating too complicated types.

(Control.Arrow.<<<) also answers the question for an appropriate type 
signature: All involved actions must use the same exception type. If the 
types mismatch, it would be easy to convert exceptions of different types 
to a unifying type.



More information about the Libraries mailing list