How do I create dynamic exceptions

Bayley, Alistair Alistair_Bayley@ldn.invesco.com
Tue, 22 Jul 2003 12:51:24 +0100


Exceptions, again...

The docs for Control.Exception say (for Dynamic exceptions): "When using
dynamic exceptions it is advisable to define a new datatype to use for your
exception type, to avoid possible clashes with dynamic exceptions used in
other libraries."

So I went with that and created a datatype for my exceptions:

> data MyException = MkExc Int String

... but now it seems I have to install this as an instance of Typeable, and
I don't see how to do that.

> instance Typeable MyException where
>   typeOf ? = ?


*****************************************************************
The information in this email and in any attachments is 
confidential and intended solely for the attention and use 
of the named addressee(s). This information may be 
subject to legal professional or other privilege or may 
otherwise be protected by work product immunity or other 
legal rules.  It must not be disclosed to any person without 
our authority.

If you are not the intended recipient, or a person 
responsible for delivering it to the intended recipient, you 
are not authorised to and must not disclose, copy, 
distribute, or retain this message or any part of it.
*****************************************************************