mapException type under extensible exceptions
|Reported by:||Isaac Dupree||Owned by:||igloo|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
The old type is
mapException :: (Exception -> Exception) -> a -> a
e.g. you might map have mapped a DivZeroError to a dynamic exception of some sort (gee, I don't know). Of course the "dynamic exception" will be less of a hack when the code is converted to extensible exceptions.
In any case that doesn't work with the 6.9-current signature
mapException :: (Exception e) => (e -> e) -> a -> a
because DivZeroErrors are not necessarily the same type as the exceptions you're throwing, obviously!
The old signature is closer in meaning to
mapException :: (SomeException -> SomeException) -> a -> a
which is isomorphic to
mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a
which I think is the inferred type, and ought to be the explicit type too.