Functions Without Borders

Unbounded recursion is when we can’t predict the number of repetitions for a recursive function. For example, it’s hard to predict how many iterations a web crawler that navigates and downloads web pages will have. For each page it browses, it finds new links to crawl. Since we’re not the owners of the pages, we can’t predict how many links each page will have. For every page the crawler downloads, the list of pages that needs to be crawled can increase. The web crawler also needs to be cautious with pages it has already visited so it avoids circular references and infinite recursion. All these characteristics of the web crawler represent unbounded recursion challenges, and a functional programmer must be prepared to ...

Get Learn Functional Programming with Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.