Posts tagged "haskell":
Calculating Fibonacci numbers: a non-recursive formula
15 Jul 2024
I recently discovered that there is a non-recursive formula for calculating Fibonacci numbers. fibn
below is a naive implementation in Python (with fibr
as a matching naive implementation of the recursive algorithm):
Elixir: resolve circularity with laziness!
19 Apr 2024
Following on from my recent post on Knuth–Morris–Pratt illustrated, here is another perfectly acceptable haskell function (copied verbatim from the paper):
(...)Faking a recursive closure in elixir
17 Apr 2024
Recursive closures do not seem to be available in elixir (or erlang). An example discussion is on the elixir forum here. However, I recently had need of such a facility.
(...)