[Haskell-cafe] Re: Referential Transparency and Monads
Brandon S. Allbery KF8NH
allbery at ece.cmu.edu
Fri Apr 10 00:46:54 EDT 2009
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] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university KF8NH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090410/f83d133d/PGP.bin
More information about the Haskell-Cafe
mailing list