I’m looking for a Haskell function which yield a value which slowly changes as wall-time elapses (and possibly wraps around after a while). I don’t really mind whether it’s IO Integer or IO Double or what. I just want a value that slowly changes as wall-time elapses.
Presumably there is an answer buried somewhere in the depths of the time package. (Or maybe old-time, but I presume that’s deprecated?) However, the time package seems really, really complicated. And I don’t actually care about timezones or human-readable time representations or anything. I just want a number that changes as wall-time elapses.
Can anybody show me a simple code snippet to do that? (Without me spending three days trying to figure out the complexities of the time package…)
From the Real World Haskell book: