News for hackers. Stuff that matters.
Re:Dynamic programming in Haskell: automatic memoization by simiones on Tuesday June 20, 2023 @06:31AM (#36402030)
Does this technique keep the memoization table in memory while the top level function is in scope (so essentially forever?) Or does it become unreachable once the initial call to fib from somewhere else finish?
Re:Dynamic programming in Haskell: automatic memoization by byorgey on Tuesday June 20, 2023 @09:29AM (#36403671)
It keeps the table in memory while the function is in scope.
Re:Dynamic programming in Haskell: automatic memoization by tsimionescu on Tuesday June 20, 2023 @10:47AM (#36404847)
I assume this could be fixed by using a lambda instead of a top level function if you only want to occasionally call such a function, and don't need the whole memoization table around all the time?
Re:Dynamic programming in Haskell: automatic memoization by consilient on Thursday June 22, 2023 @05:28AM (#36429756)
Yes, although you need to make sure it doesn't get optimized away.