[Haskell-cafe] evaluation semantics of bind

Gregg Reynolds dev at mobileink.com
Thu Feb 5 11:33:42 EST 2009

On Thu, Feb 5, 2009 at 10:00 AM, Lennart Augustsson
<lennart at augustsson.net> wrote:
> There's nothing magic about IO when it comes to monad semantics.
> If you take ghc's implementation of IO, it's a state monad.

Doesn't that mean the semantics are defined by the implementation?  My
problem is that I'm not seeing how correct eval sequencing can be
forced unless a magic token is passed around, which means that /some/
such hidden semantics must be part of the formal semantics of IO.  In
other words, it's not enough for it to be a monad, since >>= by itself
cannot guarantee data dependency.  If it doesn't pass around the World
token, we don't get sequencing.


More information about the Haskell-Cafe mailing list