<[EMAIL PROTECTED]> wrote,
> Adrian Hey writes:
> > 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?
>
> I'm not surprised you are puzzled. Concurrent Haskell, as
> implemented in ghc, does NOT preserve referential
> transparency, nor could it.
Of course it does! If it wouldn't many of the optimisations
performed by GHC would be invalid and you would be doomed if
you compiled a Concurrent Haskell module with -O (actually,
you would most certainly already be doomed without -O).
Check out the type signatures of the `MVar'-related
operations and you will find that they are all nicely
encapsulated in the `IO' monad.
Manuel
PS: We don't have referential transparency in C, because K&R
didn't know Phil Wadler ;-)