Inaccurate docs for atomically

Henning Thielemann lemming at henning-thielemann.de
Sun Nov 12 16:28:02 UTC 2017


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.


More information about the Libraries mailing list