On Thu, Jan 21, 2010 at 1:35 PM, Dan Bron <[email protected]> wrote:
> The IO monad differs from the filename in that it represents
> the-file-at-that-time, so if you invoked it again after the file
> changed, strictly speaking you've passed in a different input,
> so a different output is justifiable.  This is just making the
> contents of the file, an implicit input,  explicit.  That said, it
> seems like monads, as a syntactic construct, would allow you to
> make this explicit input implicit again (for convenience's sake).

One of the challenges of monadic programming is that the
philosphical underpinnings are such that each reference
to "state of the world" really represents "the state of the world".

Thus, if you referred to the same instance in multiple places
you should get the same result.

In other words, the language is designed to record all of history.

However, practically speaking, this is just a good way of making
your program blow up.

So, monads tend to be designed to discourage people from
holding on to references to "the state of the world".

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to