Recursion is a key technique in FP, to the degree that there are some languages that do not provide for any kind of iteration or loops and work exclusively with recursion (Haskell, which we already mentioned, is a prime example of that). A basic fact of computer science is that whatever you can do with recursion, you can also do with iteration (loops), and vice versa. The key concept is that there are many algorithms whose definition is far easier if you work recursively. On the other hand, recursion is not always taught, or many programmers, even knowing about it, prefer not to use it. Therefore, in this section, we shall see several examples of recursive thinking, so that you can adapt it for your functional coding.
Dictionary definition:
recursion: (n) see recursion
But what is recursion? There are many ways...