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 
 
=============================================================================== 
 
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to