Throwing and catching exceptions in STM

24 Sep
2010
24 Sep
'10
4:21 p.m.
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
5355
Age (days ago)
5355
Last active (days ago)
0 comments
1 participants
participants (1)
-
Bas van Dijk