3 ms·
The same way you would be prevented from doing non-transactional things between calls to transaction.start() and transaction.end()
by slondr 3y ago
The same way you would be prevented from doing non-transactional things between calls to transaction.start() and transaction.end()
- mrkeen 3y agoWhen I write this: someTransaction = do incrementCounter writeFile "foo.txt" "bar" decrementCounter I get this: src/Lib.hs:11:5: error: • Couldn't match type ‘IO’ with ‘STM’ Expected: STM () Actual: IO () • In a stmt of a 'do' block: writeFile "foo.txt" "bar" In the expression: do incrementCounter writeFile "foo.txt" "bar" decrementCounter In an equation for ‘someTransaction’: someTransaction = do incrementCounter writeFile "foo.txt" "bar" decrementCounter | 11 | writeFile "foo.txt" "bar" | ^^^^^^^^^^^^^^^^^^^^^^^^^