Generalise the type of mapException; pointed out by Isaac Dupree
authorIan Lynagh <igloo@earth.li>
Mon, 4 Aug 2008 16:09:41 +0000 (16:09 +0000)
committerIan Lynagh <igloo@earth.li>
Mon, 4 Aug 2008 16:09:41 +0000 (16:09 +0000)
Control/Exception.hs

index b3638f6..812c165 100644 (file)
@@ -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)))