Fri, 8 Oct 1999 01:22:43 +0100 (BST), Adrian Hey <[EMAIL PROTECTED]> pisze:

> 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 think that referential transparency simply depends on what entities
in the language we call `variables' and what methods of their usage
we call `referencing'.

Since languages can be very different and their concepts are not
mapped one-to-one between languages, there is no universal definition
of referential transparency that can be unambiguously applied to
any language.

In Haskell a `variable' can be meant to be either a name introduced
by a let/where/lambda/case binding, or one of IORef/STRef/MVar (or
even something in a custom monad). The first concept is referentially
transparent, the second is not if we think about the contents of
*Refs/MVars as `values of variables' and thus usages from different
(>>=)-separated segments in the relevant monad.

(I'm not sure whether I understand the referential transparency issue
correctly at all, sorry if it's all wrong.)

In other words, implementing an interpreter of a non-referentially
transparent language in the referentially transparent language does
not change the answer for the implementing language, because we start
talking about different concepts.

Similarly, matrices can be comutative or not, depending on whether
we talk about their addition or multiplication.

> I can accept that we have referential transparency for user defined
> monads, but not the IO monad.

It is satisfied for both or for neither, depending on from what side
we look at them and how we assign names to concepts.

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://kki.net.pl/qrczak/
 \__/          GCS/M d- s+:-- a22 C+++>+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-




Reply via email to