Hello,<br> I am getting familiar with FP now, and I have a "program design" kind of question.<br> Say I have something like this in C:<br>static int old;<br>int diff (int now) { /* this would be called once a second */<br>
int ret = now - old;<br> old = now;<br> return ret;<br>}<br> Because there is no "variable" in Haskell. So how to do this in a FP way?<br><br>Thanks.<br>