[Haskell-cafe] On the purity of Haskell

Gregg Reynolds dev at mobileink.com
Fri Dec 30 18:45:34 CET 2011


On Dec 30, 2011, at 11:11 AM, Chris Smith wrote:

> 
>> time t:  f 42   (computational process implementing func application
>> begins…)
>> t+1:   <keystroke> = 1
>> t+2:  43   (… and ends)
>> 
>> 
>> time t+3:  f 42
>> t+4:  <keystroke> = 2
>> t+5:  44
>> 
>> 
>> Conclusion:  f 42 != f 42
> 
> That conclusion would only follow if the same IO action always produced
> the same result when performed twice in a row.  That's obviously untrue,
> so the conclusion doesn't follow.  What you've done is entirely
> consistent with the fact that f 42 = f 42... it just demonstrates that
> whatever f 42 is, it doesn't always produce the same result when you o
> it twice.
> 
> What Conal is getting at is that we don't have a formal model of what an
> IO action means.

Right, and my little counter-example is intended to support that.

>  Nevertheless, we know because f is a function

We do?


More information about the Haskell-Cafe mailing list