
21 Aug
2014
21 Aug
'14
1 a.m.
On 20-08-2014 21:24, Alexander Pakhomov wrote:
ref <- newIORef 0 forM_ [0..100000] $! \i -> do modifyIORef' ref (+(foo $ fromInteger i)) -- for foo not to optimize out readIORef ref >>= print
ghc -O2 sort.hs && time ./sort
My first recommendation is to use criterion. It will get you a way better idea of the timing needed for your function, specially since it does not do much work. Cheers, -- Felipe.