
17 Jul
2012
17 Jul
'12
9:28 a.m.
Simon Marlow wrote:
The fact that you can't do arbitrary side effects in ST follows from the definition of safety and the fact that runST injects ST computations into pure computations. So there's really no design choice here. The same applies to the Par monad, and any monad that injects into pure computations.
I disagree about there not being a choice. As I wrote, if the injection function is Unsafe (i.e., not Trustworthy), then there is no safe way to inject the computations and then those computations can do what they want (as far as Safe Haskell is concerned) because they can't be safely executed anyway. So it really depends on whether or not the injection function has been declared Trustworthy. Roman