On 2009 Apr 10, at 0:33, Heinrich Apfelmus wrote:
Luke Palmer wrote:
Miguel Mitrofanov wrote:

I'm not sure what you mean by that, but semantically IO is definitely
*not* a state monad. Under any circumstances or any set of assumptions.

Ehm? Why not?

Mainly forkIO.  There may be other reasons.
 loop' :: IO ()
 loop' = putStr "o" >> loop'

are indistinguishable in the

 IO a  ~  World -> (a, World)


I still don't understand this; we are passing a World and getting a World back, *conceptually* the returned World is modified by putStr. It's not in reality, but we get the same effects if we write to a buffer and observe that buffer with a debugger --- state threading constrains the program to the rules that must be followed for ordered I/O, which is what matters.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [email protected]
system administrator [openafs,heimdal,too many hats] [email protected]
electrical and computer engineering, carnegie mellon university    KF8NH


Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to