No instance for (UncaughtException MyException)
arising from a use of `g' at examples/docatch.hs:21:32-35
Possible fix:
add an instance declaration for (UncaughtException MyException)
In the expression: g ()

is the type checker saying:

"hey, you are trying to run a computation which throws a MyException without handling it, and I won't let you"

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.

Subtyping

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
Exception instances.
For example,
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.

Takes a value of type a and returns a concrete representation
of that type. The value of the argument should be ignored by
any instance of Typeable, so that it is safe to pass undefined as
the argument.

Wrap the failure value, if any, with the given function. This is
useful in particular when you want all the exceptions returned from a
certain library to be of a certain type, even if they were generated by
a different library.