
Fine reasoning.
Pure means incorruptible. It means that a pure result can be reused again
and again -like the gold or silver- while an impure result must be
re-created whenever it must be used. The metaphor is natural and I guess
that the use of pure (rather than referential transparent) is informal, but
as unavoidable as useful. By the way, there are deeper considerations
here: To deal with pure values, like incorruptible stuff, like gold implies
lower information costs and that´s one of the reasons why they are valuable.
In this sense, we can give a positive meaning to unsafePerformIO and change
its name to "purify" or even "pasteurize" or "lyophilize" ;)
2013/8/7 Jerzy Karczmarczuk
Richard A. O'Keefe :
Haskell has **trained** my intuition to see 'putStrLn "Hi"' as a pure value; it's not the thing itself that has effects, but its interpretation by an outer engine, just as my magnetic card key has by itself no power to open doors, but the magnetic reader that looks at the card_does_.
I am the last here who would quarrel with Richard O'K., but I firmly believe that such reasoning is a Pandora box.
The King, the government, the Pope, etc. have no power, only the interpretation of their decrees by "outer agents" _does_ things.
Saying that the Justice of the country X is lousy is a harmful abuse. Our Justice is good, only its interpretation by some incompetent traitors gave rise to all these calamitous events.
You see what I mean?... Are we going to switch now to the Mind-Body dilemma?
==
BTW. Saying that "5" is a pure value means only that the whole of the underlying system treats it as such. The object "5" couldn't care less. It even doesn't know that in some programming language it is equivalent to an action which puts it on the evaluation stack.
That's why for me the "purity" (while teaching I try to avoid this word) means simply that whatever you do with the object, it won't fire a "magic" process. As Richard, I do not claim that this is "right", but it surely facilitated my teaching of Haskell. My students have already more than enough of my /philosophie de pacotille/...
Jerzy Karczmarczuk
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Alberto.