On Thu 07 Oct, I wrote:
> On Wed 06 Oct, Johan Nordlander wrote:
> > Just to avoid any unfortunate misconceptions: O'Haskell definitely
> > preserves the property we commonly refer to as referential transparency,
> > and so does Concurrent Haskell, or any other sound monadic extension of
> > the language.
> 
> Hmm, I obviously don't understand what 'referential transparency' means.
> I must say I'm puzzled by statements like this. If the presence of
> mutable variables (and MVars in Concurrent Haskell) preserve referential
> transparency, then why _don't_ we have referential transparency in C?
> 
> Does it have something to do with denotational semantics and world
> models containing infinite trees of random numbers?

On Wed 06 Oct, Johan Nordlander replied:
> I'd say that an absolutely brilliant exposition of this topic is to be 
> found in Phil Wadler's paper "How to declare an imperative", available 
> on the web at
>
>  http://www.cs.bell-labs.com/who/wadler/topics/monads.html

I've read this paper, and it is good, but I still see no reason to 
change my opinion regarding referential transparency and IO.
But I am terribly confused about this issue, there seems to be no real
consensus about this in the FP world. I just can't see how if the
result of an action is dependent on unknown external world agents
(as it is with the IO monad) it could be described as referentially
transparent. I can accept that we have referential transparency for
user defined monads, but not the IO monad.   

Reaction to my recent suggestion regarding IO (a concurrent non-deterministic
machine) on the Clean discussion list was somewhat less than enthusiastic.
One of the reasons was that apparently this would result in loss of
referential transparency. (I never believed we had this anyway, so I
didn't see this as a problem:-) Yet Concurrent Haskell is also based on a
non-deterministic concurrent machine, with mutable variables shared
by independent threads, but this preserves referential transparency?

Unless I'm missing something, these two views are not consistent :-(

Regards
-- 
Adrian Hey




Reply via email to