On Tue, Jul 22, 2003 at 02:59:12PM +0100, Bayley, Alistair wrote:
> > handler :: Dynamic -> IO ()
> > handler e = do
> >   case (fromDynamic e) of
> >    Nothing -> putStrLn ("dynamic cast failed")
> >    Just (MkExc n s) -> putStrLn ("exception: " ++ (show n) ++ " " ++ s)
> 
> > main :: IO ()
> > main = catchDyn temp handler

You're catching a Dynamic wrapped as a Dynamic (catchDyn already does
fromDynamic, as indicated by its type).  Change the handler to

> handler :: MyException -> IO ()
> handler (MkExc n s) = putStrLn ("exception: " ++ (show n) ++ " " ++ s)

any other dynamic exception fails through to the top level.
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to