Re:Functional programming languages should be better at muta...
by narski on Tuesday July 30, 2024 @09:57PM
(#41115825)
>The standard way to expel stated mutable state us to push it into function parameters and returned values.
This is precisely what I did in my Hoon solution :) However, I wasn't aware that this approach is the standard way, and I'm glad to have learned that! Thanks
With Fibonacci numbers, you cab just compute two if them outright:
Now there is no mutable state that survives between function calls, the performance is linear.With true memoization though accessing a previously computed value.would be constant time.