
9 Apr
2008
9 Apr
'08
3:23 p.m.
decPair v1 v1 :: TVar Int -> TVar Int -> IO () decPair v1 v2 = atomically (decT v1 `orElse` decT v2)
Will this actually compile? I was under the impression that 'orElse' could only combine STM types, not IO () types.
The type of atomically is STM a -> IO a.
But orElse :: STM a -> STM a -> STM a decT can be of type TVar Int -> STM () if you leave out the atomically. -- Ariel J. Birnbaum