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