
11 Apr
2011
11 Apr
'11
10:18 a.m.
Serguei Son
Also, please note that I can force the evaluation of c_sin, e.g.
mapM (return . c_sin) [1..n] >>= (print $ foldl' (+) 0)
And it will still execute reasonably fast.
Pls disregard the my previous post. I actually meant let lst = map c_sin [1..n] print $ foldl' (+) 0 lst This executes in 0.2 s for n = 10^7. c_sin is safe, as well as c_sin_m. The only difference is CDouble -> CDouble vs CDouble -> IO CDouble.