Skip to content

mapException type under extensible exceptions

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.

Trac metadata
Trac field Value
Version 6.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information