Hello,

The IO monad has the following function for throwing an exception:

throwIO :: Exception e => e -> IO a

Is there an analogous way of throwing an exception in the STM monad?

I can try using: throw ::  Exception e => e -> a.

But does this guarantee ordering with respect to other STM actions?

The IO monad has the following function for catching exceptions:

catch :: Exception e => IO a -> (e -> IO a) -> IO a

Why is catchSTM defined as:

catchSTM :: STM a -> (SomeException -> STM a) -> STM a

And not as the more general and more consistent:

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

Thanks,

Bas
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to