
25 Feb
2009
25 Feb
'09
12:46 p.m.
Dusan Kolar wrote:
Nevertheless, local version does not work.
Restructure your code like this:
fibL m = let allfib = 0:1:[allfib!!n + allfib!!(n+1) | n <- [0..]] in allfib !! m
fibL = let allfib = 0:1:[allfib!!n + allfib!!(n+1) | n <- [0..]] in \m -> allfib !! m i.e. move the definition of the memo table outside the scope of the specific parameter you want to memoise over. Cheers, Ganesh =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ===============================================================================