On Mon, Nov 3, 2008 at 12:53 PM, Duncan Coutts <[EMAIL PROTECTED]> wrote: > On Mon, 2008-11-03 at 09:26 -0800, Sigbjorn Finne wrote: >> One way to do this now is to use Control.Exception.catches: >> >> catches :: IO a -> [Handler a] -> IO a >> data Handler a where >> Handler :: forall a e. (Exception e) => (e -> IO a) -> Handler a > > ie: > > action > `catches` > [ \(e :: ExitCode) -> ... > , \(e :: PatternMatchFail) -> ... > ] > > or just by using multiple catch clauses: > > action > `catch` (\(e :: ExitCode) -> ...) > `catch` (\(e :: PatternMatchFail) -> ...)
I don't think those are equivalent. In the second case, the PatternMatchFail handler scopes over the ExitCode handler. -- Dave Menendez <[EMAIL PROTECTED]> <http://www.eyrie.org/~zednenem/> _______________________________________________ Glasgow-haskell-users mailing list [email protected] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
