
24 Feb
2008
24 Feb
'08
1:32 p.m.
This is pretty cool, but I have one warning:
On Sat, Feb 23, 2008 at 4:37 PM, Uwe Hollerbach
data MyInterrupt = MyInt Int instance Typeable MyInterrupt where typeOf x = typeOf (0 :: Int)
I am pretty sure that this makes Dynamic unsound; you could accidentally cast from an Int to a MyInterrupt or vice versa. Try this instead:
data MyException = Interrupt deriving Typeable
then you can safely use throwDyn and catchDyn on this type. -- ryan