
On Mar 8, 2010, at 19:55 , Travis Erdman wrote:
The code I pasted was a timing function I've come across in various Haskell literature, and it "works" as is ... at least, the timing results it prints are plausible.
My sole "contribution" to the code was the "print v" line, in an attempt to have it print BOTH the result of the function evaluation AND the time it took to evaluate it (and still only evaluating the function once).
The root of the problem is that seq forces its first argument but returns its second, so you're getting () back from it. I'm not sure what the approved way to fix it is. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH