TCO + strictnesses annotations should take care of your problem.
On 28 Nov 2012 11:44, "Branimir Maksimovic" <bmaxa@hotmail.com> wrote:_______________________________________________Problem is following short program:list = [1,2,3,4,5]advance l = map (\x -> x+1) lrun 0 s = srun n s = run (n-1) $ advance smain = dolet s = run 50000000 listputStrLn $ show sI want to incrementally update list lot of times, but don't knowhow to do this.Since Haskell does not have loops I have to use recursion,but problem is that recursive calls keep previous/state parameterleading to excessive stack.and memory usage.I don't know how to tell Haskell not to keep previousstate rather to release so memory consumption becomesmanagable.Is there some solution to this problem as I think it is rathercommon?
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe