
12 Nov
2017
12 Nov
'17
11:28 a.m.
On Sun, 12 Nov 2017, Andrew Martin wrote:
In the stm package, the docs for atomically read:
You cannot use 'atomically' inside an 'unsafePerformIO' or 'unsafeInterleaveIO'. Any attempt to do so will result in a runtime error. (Reason: allowing this would effectively allow a transaction inside a transaction, depending on exactly when the thunk is evaluated.)
I always thought that it would be the other way round, i.e. that you cannot call 'unsafePerformIO' inside an 'atomically'. Maybe I mixed something up.