Throws is a type level binary relationship
used to model a list of exceptions.
There is only one case in which the user must
add further instances to Throws, and that is
to encode the hierarchy of exceptions.
As there is no way to automatically infer
the subcases of an exception, they have to be encoded
manually mirroring the hierarchy defined in the defined
the following instance encodes that MyFileNotFoundException is
a subexception of MyIOException :
instance Throws MyFileNotFoundException (Caught MyIOException l)
Throws is not a transitive relation and every ancestor relation
must be explicitly encoded.
instance Throws MidException (Caught TopException l) -- |
instance Throws ChildException (Caught MidException l) -- |
instance Throws ChildException (Caught TopException l) -- |
SomeException is automatically
an ancestor of every other exception type.