From: Ian Lynagh Date: Mon, 4 Aug 2008 16:09:41 +0000 (+0000) Subject: Generalise the type of mapException; pointed out by Isaac Dupree X-Git-Tag: 6_10_branch_has_been_forked~86 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0598083cfccabdb9064c259c698d05fc79fc1a9e;p=ghc-base.git Generalise the type of mapException; pointed out by Isaac Dupree --- diff --git a/Control/Exception.hs b/Control/Exception.hs index b3638f6..812c165 100644 --- a/Control/Exception.hs +++ b/Control/Exception.hs @@ -358,7 +358,7 @@ handleJust p = flip (catchJust p) -- Notice that the usage of 'unsafePerformIO' is safe here. -mapException :: Exception e => (e -> e) -> a -> a +mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a mapException f v = unsafePerformIO (catch (evaluate v) (\x -> throw (f x)))