Alistair,

I'm throwing my own exceptions in my own monad, not the IO one. But thanks for pointing me to the stuff about dynamic types. I'm going to be creative and pick some new names.

- Lyle

Bayley, Alistair wrote:

What is wrong with creating your own catch and throw with different names?
e.g.

 data MyException = MyException ...
   deriving (Typeable, Show)

 catchMyEx :: IO a -> (MyException -> IO a) -> IO a
 catchMyEx = catchDyn
 throwMyEx :: MyException -> a
 throwMyEx = throwDyn



But there might be code that uses 'throw' and doesn't really care which one is used, and it would be nice to just modify the import line and be done with it.



Can you expand on this? (more example code?) If you want to throw your own exceptions, then you must use throwDyn/catchDyn, so you have to use something other than catch/throw anyway.

Alistair.


_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to