On Wed 06 Oct, Alex Ferguson wrote:
> Me:
> > >  Your 'partial' list would appear, from a initial
> > > inspection, to leave little left of either type safety or referential
> > > transparency. 
> 
> KA:
> > I can not see how State encapsulation will
> > weaken any type system.
> 
> No, that's be the 'referential transparency' part of the above.
> (I assume you're talking about something considerably different
> from state-by-monads, here.)

Is referential transparency really such a sacred cow? Sometimes
side effects are useful IMHO e.g. for IO. (Though the Cleaners regard
IO as being referentially transparent for technical reasons which I
don't quite understand.)

I've been looking at Concurrent Haskell, and more recently Johan
Nordlanders O'Haskell. I think there's a good deal of sense in both
these dialects of Haskell (I especially like the idea of getting rid
of the evil I:-)

To me, the important thing is that it should be clear when we do and
when we don't have referential transparency. Where we don't, words
like 'operation' or 'action' should be used instead of 'function'.

So I can see nothing wrong with encapsulated (mutable) state, in principle,
just so long as the state is only mutated by 'actions'.

Regards 
-- 
Adrian Hey




Reply via email to