On Tue, Jan 24, 2006 at 06:40:38PM +0000, Ben Rudiak-Gould wrote: > Ross Paterson wrote: > >But IO isn't a state monad: others are concurrently changing the world > >without waiting for my Haskell program to terminate. > > I think that closed-world behavior should be treated as a property of > runST, not of the ST monad operations. Otherwise your IORef = STRef > IORegion proposal doesn't work either, because e.g. > > myId :: STRef s a -> a -> ST s a > myId r x = writeSTRef r x >> readSTRef r > > doesn't necessarily return its second argument when lifted to IO, in the > presence of multithreading.
Ouch! Being able to do that kind of reasoning in ST is really important. I'd rather sacrifice stToIO than lose that. _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell