[Haskell-cafe] Re: Referential Transparency and Monads
barsoap at web.de
Fri Apr 10 06:54:56 EDT 2009
Jonathan Cast <jonathanccast at fastmail.fm> 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?
Inside and outside become quite mindboggling when dealing with more
dimensions than you expect...
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.
More information about the Haskell-Cafe