
12 Jan
2007
12 Jan
'07
11:20 a.m.
On 1/12/07, Chad Scherrer
Hi,
I'd like to be able to use randomIO, but I'm working within the context of STM. Is there a way to get these working together happily?
For now, I guess I could kludgingly use unsafePerformIO inside STM (it's the other way around that's not allowed, right?), but I would need to be sure it doesn't get inlined.
You could use GHC.Conc.unsafeIOToSTM. Just be aware that your transaction may be re-executed an arbitrary number of times. -- Cheers, Lemmih