
On Thu, Dec 10, 2009 at 11:56 AM, Sebastian Sylvan
On Thu, Dec 10, 2009 at 3:30 PM, John D. Earle
wrote: My intuition says that laziness and purity are distinct whereas yours says that purity is a necessary condition. This is what needs to be reconciled.
I think laziness requires purity to make sense. Laziness implies that the order of evaluation is highly unpredictable and depends strongly on the implementation details of libraries and such (which you may not have access to). So it's fickle. Someone adds an if statement somewhere and all of a sudden a variable gets evaluated earlier than it used to. It would be madness to write any code which depends on this unpredictable behaviour. In other words, the expressions that get evaluated lazily must not have side effects.
Yes, this is discussed in section 3.2 of the paper I cited earlier (http://research.microsoft.com/en-us/um/people/simonpj/papers/history-of-hask...). That paper gives some nice insight into the history of Haskell.