
26 Sep
2010
26 Sep
'10
8:09 p.m.
On Sun, 2010-09-26 at 15:46 -0400, Simon Marlow wrote:
On 26/09/10 13:55, Bas van Dijk wrote:
On Sun, Sep 26, 2010 at 6:13 PM, Antoine Latter
wrote: Your new catchSTM can be written from the old one:
newCatchSTM stm h = catchSTM stm (h . fromJust . fromException . toException)
Agree in principle, but I don't think that implementation works, does it? If the exception is the wrong type, fromJust will throw an error, whereas you want to just re-throw the original exception.
I will make a patch out of this and attach it to the ticket. We'll see what the GHC devs think of it.
Fine by me.
Cheers, Simon
newCatchSTM stm h = catchSTM stm (\e -> maybe (throwSTM e) f $ fromException e) Regards