<br><br><div class="gmail_quote">On 30 December 2011 17:17, Gregg Reynolds <span dir="ltr">&lt;<a href="mailto:dev@mobileink.com">dev@mobileink.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br><div><div>On Dec 30, 2011, at 11:04 AM, Colin Adams wrote:</div><br><blockquote type="cite"><br><br><div class="gmail_quote">On 30 December 2011 16:59, Gregg Reynolds <span dir="ltr">&lt;<a href="mailto:dev@mobileink.com" target="_blank">dev@mobileink.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><br><div><blockquote type="cite"><div class="gmail_quote">On Fri, Dec 30, 2011 at 12:49 AM, Heinrich Apfelmus <span dir="ltr">&lt;<a href="mailto:apfelmus@quantentunnel.de" target="_blank">apfelmus@quantentunnel.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
The function<br><div>
<br>
  f :: Int -&gt; IO Int<br></div>
  f x = getAnIntFromTheUser &gt;&gt;= \i -&gt; return (i+x)<br>
<br>
is pure according to the common definition of &quot;pure&quot; in the context of purely functional programming. That&#39;s because<br>
<br>
  f 42 = f (43-1) = etc.<br>
<br>
Put differently, the function always returns the same IO action, i.e. the same value (of type  IO Int) when given the same parameter.<br></blockquote><div><br><br></div></div></blockquote></div><div><br></div><div><div class="im">
time t:  f 42   (computational process implementing func application begins…)<br>
<div>t+1:   &lt;keystroke&gt; = 1</div><div>t+2:  43   (… and ends)</div><div><br></div><div>time t+3:  f 42</div><div>t+4:  &lt;keystroke&gt; = 2</div><div>t+5:  44</div><div><br></div><div>Conclusion:  f 42 != f 42</div>

<div><br></div></div><div>(This seems so extraordinarily obvious that maybe Heinrich has something else in mind.)</div><span></span><br></div></div></blockquote></div>This seems such an obviously incorrect conclusion.<br>

<br>f42 is a funtion for returning a program for returning an int, not a function for returning an int.<br>
</blockquote></div><div><br></div><div>My conclusion holds:  f 42 != f 42.  Obviously, so I won&#39;t burden you with an explanation. ;)</div><span class="HOEnZb"><font color="#888888"><br><div>-Gregg</div></font></span></div>
</blockquote></div>Your conclusion is clearly erroneous.<br><br>proof: f is a function, and it is taking the same argument each time. Therefore the result is the same each time.<br>