Guarantees for ST and IO shared in common?
cma at bitemyapp.com
Wed Feb 3 23:30:21 UTC 2016
Underlying ST is: GHC.Prim.State# s -> (# GHC.Prim.State# s, a #)
Underlying IO is: GHC.Prim.State# GHC.Prim.RealWorld
-> (# GHC.Prim.State# GHC.Prim.RealWorld, a #)
Based on the (very helpful!) conversation I had on the #ghc IRC channel, it
seems to me that the mechanism for preventing things like reordering
operations or spurious sharing is shared in common between ST and IO via
State#. Is this accurate? I believe the exception is how RealWorld is used
w/ IO but we can put that off for this question.
If anyone could confirm this understanding that would be helpful. If anyone
could point out exceptions to this notion, I'd very much appreciate that as
Thanks again for everyone's time.
Currently working on http://haskellbook.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs