O'Reilly logo

Functional C# by Wisnu Anggoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Learning Recursion

In the first announcement of functional programming, many functional languages didn't have the loop feature to iterate the sequence. All we had to do was construct the recursion process to iterate the sequence. Although C# has iteration features such as for and while, it is better if we discuss recursion in the functional approach. Recursion will also simplify our code. To do that, in this chapter, we will discuss the following topics:

  • Understanding how the recursive routine works
  • Refactoring an iteration into a recursion
  • Distinguishing tail recursion between the accumulator-passing style and the continuation-passing style
  • Understanding indirect recursion over direct recursion
  • Applying recursion in the functional approach ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required