Proposal: Extensible exceptions

shelarcy shelarcy at
Fri Jul 4 14:00:53 EDT 2008

On Fri, 04 Jul 2008 22:29:24 +0900, Ian Lynagh <igloo at> wrote:
> This is a proposal to replace the current exception mechanism in the
> base library with extensible exceptions.

I like this change.

> The patches are here:
> I've attached Examples.hs, which gives some examples of using it.

But It seems that current patches doesn't change GHC.Conc module's
catchSTM type. I think we should change that type, too.

  catchSTM :: Exception e => STM a -> (e -> STM a) -> STM a

But One problem is that these changes also affect stm package's
interface. We need following functions, and old interface same as
IO type catching functions, for usability.

  catchesSTM :: STM a -> [Handler a] -> STM a
  catchSTMAny :: STM a -> (forall e . Exception e => e -> STM a) -> STM a

Do you think we should have another proposal to change catchSTM
type, after accepting this proposal?

Best Regards,

shelarcy <shelarcy>

More information about the Libraries mailing list