The Fibonacci sequence is a classical hello-world application for functional programming. The challenge here is to get a fast implementation. We will first show two classical implementations: the trivial recursive definition that is very slow and the iterative version that is slightly faster.
And a third one that is blazing fast.
So here is my own version...
- the source code in Literate Haskell: fibonacci.lhs
- the document rendered in Markdown: fibonacci.md