[Haskell-cafe] Referential Transparency and Monads

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Fri Apr 10 01:05:42 EDT 2009

On 2009 Apr 10, at 1:00, Jonathan Cast wrote:
> On Fri, 2009-04-10 at 07:29 +0400, Miguel Mitrofanov wrote:
>> On 10 Apr 2009, at 06:30, Jonathan Cast wrote:
>>> do
>>>    s <- readFile "/my_file"
>>>    writeFile "/my_file" "Hello, world!\n"
>>>    threadDelay 10000 -- If you don't like threadDelay, just
>>> substitute forcing
>>>                      -- an expensive thunk here
>>>    writeFile "/my_file" s
>>> As a function from initial state to final state, this program is  
>>> just
>>> the identity;
>> No, since world state includes the user state itself, not just files
>> contents.
> My programs are passing me around inside a state token?

You seem to have redefined "conceptually" to mean "in absolute  

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/ced465a0/PGP.bin

More information about the Haskell-Cafe mailing list