Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2483 closed bug (fixed)

mapException type under extensible exceptions

Reported by: Isaac Dupree Owned by: igloo
Priority: normal Milestone:
Component: libraries/base Version: 6.9
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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.

Change History (4)

comment:1 Changed 9 years ago by igloo

difficulty: Unknown
Owner: set to igloo

Makes sense, and I think we discussed it in the proposal thread; I'll make the change.

comment:2 Changed 9 years ago by igloo

Resolution: fixed
Status: newclosed


comment:3 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:4 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.