
20 Sep
2008
20 Sep
'08
12:17 p.m.
Am Samstag, 20. September 2008 17:46 schrieb Andre Nathan:
On Sat, 2008-09-20 at 14:56 +0200, Daniel Fischer wrote:
modify' f = do s <- get put $! f s
Or try Control.Monad.State.Strict.
Control.Monad.State.Strict did it for me, but the strict modify didn't. I tried using modify' and also
randomDouble = do g <- get let (r, g') = random g put $! g' return r
instead of
randomDouble = State random
Any hints on how I could find where else the program is being too lazy?
Profiling. Find out where your programme spends its time and what uses the memory. Add lots of {-# SCC #-} pragmas to get a more detailed picture.
Thanks, Andre