[Haskell-cafe] Theoretical question: are side effects necessary?
Jerzy Karczmarczuk
jerzy.karczmarczuk at unicaen.fr
Sat Mar 17 03:44:16 CET 2012
Ryan Ingram:
> Other external state is harder to emulate. For example, communication
> over a network most definitely requires some concept of a 'computation
> with side effects' since the network's response could change from
> request to request.
>
> In GHC, even IO objects are pure, but they conceptually represent
> functions that modify the state of reality.
I believe I begin to become a sectarian, with some idées fixes not so
well shared...
It is the third or the fourth time that somebody recently puts the
equivalence between the communication with the outer world, and "side
effects". I contest that very strongly, perhaps a TRUE guru might
instruct me.
What a computer and the program it runs do to its hard environment has
NOTHING to do with side-effects. Even a completely angelic, pure as a
Cherub (but real) program will consume some electricity. And so what?!
Of course, in classical physics the state of the world changes
constantly (in a quantum world it is extremely ambiguous...), but the
question of purity of a program - in my opinion - concerns the program,
and nothing else. The networking is not expected to break the
referential transparency, or does it?
Jerzy Karczmarczuk
More information about the Haskell-Cafe
mailing list