Talk:Fibonacci sequence: Difference between revisions

Content added Content deleted
Line 207: Line 207:
Hi [[User:WillNess|WillNess]] , I notice that the ('''fibonacci by folding''') Haskell example has just been moved under the heading 'Iterative'. I wonder if that doesn't risk confusing a little, or even possibly misleading ?
Hi [[User:WillNess|WillNess]] , I notice that the ('''fibonacci by folding''') Haskell example has just been moved under the heading 'Iterative'. I wonder if that doesn't risk confusing a little, or even possibly misleading ?


Folds are implemented recursively (either directly or indirectly) in the Prelude, and are generally understood as 'recursion schemes' in the sense of Meier et al. (See, for example, http://blog.sumtypeofway.com/an-introduction-to-recursion-schemes/ and the much-read paper which it references).
Folds are implemented recursively (either directly or indirectly) in the Prelude, and are generally understood as 'recursion schemes' in the sense of Meijer et al. (See, for example, http://blog.sumtypeofway.com/an-introduction-to-recursion-schemes/ and the much-read paper which it references http://maartenfokkinga.github.io/utwente/mmf91m.pdf).


I also notice that other examples which have ended up in the 'Iteration' section might risk compounding a reader's confusion – they are either implemented by direct and immediate recursion on helper functions like '''go''' and '''next''', or are expressed in terms of '''zipWith''', '''scanl''' etc, which are also implemented as recursive functions.
I also notice that other examples which have ended up in the 'Iteration' section might risk compounding a reader's confusion – they are either implemented by direct and immediate recursion on helper functions like '''go''' and '''next''', or are expressed in terms of '''zipWith''', '''scanl''' etc, which are also implemented as recursive functions.