Opened 6 years ago

Closed 6 years ago

Last modified 6 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: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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 6 years ago by igloo

  • Difficulty set to 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 6 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

Done!

comment:3 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:4 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.