in reply to Re^6: How am i doing?
in thread How am i doing?

IIRC Fibonacci was also heavily used to show the advantages of Haskell in one of the canonical books.

But unfortunately I never went thru learning Haskell.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^8: How am i doing?
by Fletch (Bishop) on Jul 21, 2025 at 13:26 UTC

    You can define an (infinite, FSVO infinite limited by your patience and available RAM) list without defining a new function, just summing itself with the rest of itself: fibs = 0 : 1 : zipWith (+) fibs (tail fibs), and then you can get the first however many you need with take. Once realized it won't have to recompute anything again.

    (I did have to crib from a wiki because I couldn't remember if it was just zip or not.)

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re^8: How am i doing?
by jaredor (Priest) on Jul 29, 2025 at 19:00 UTC

    The nerf ball skirmish rages, "What is an apposite non-pedagogical example of recursion?" the casus belli; then, a pause: From a foxhole betwixt comes a plaintive query, "How about Quicksort?"