On Thu 07 Oct, Marcin 'Qrczak' Kowalczyk wrote:
> 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.)

I agree with you. I think as far as this discussion is concerned
its the monadic mutable variables which are problematic.
 
> > 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.

I would opt for the 'both' option, _provided_ the world which the IO
monad is interacting with is closed, finite and deterministic. If this
is true we should be able to develop a model the world as a Haskell data
type and associated functions which reproduce the observable properties
of the world exactly, in every detail. For example, that world could
be a dedicated hardware array processor which interacted with nothing but
the Haskell program. In such cases I would aggree that computation by
IO monad is just another form of purely functional computation, with
referential transparency intact.

Unfortunately, we can't do this for the real world. So I'm still
sceptical about IO monads.  

Regards
-- 
Adrian Hey




Reply via email to