On 17/07/12 10:28, Roman Leshchinskiy wrote:
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.

Well I suppose you *could* imagine having an Unsafe runST and then it would be fine to mark your unsafe ST operations Trustworthy, but that would be strange to say the least!

Anyway, what I'm taking away from all this is that we need to revise the Safe Haskell docs in the GHC user's guide, with lots of examples and guidance.

Cheers,
        Simon

_______________________________________________
Haskell-platform mailing list
Haskell-platform@projects.haskell.org
http://projects.haskell.org/cgi-bin/mailman/listinfo/haskell-platform

Reply via email to