47 Degrees joins forces with Xebia read more

Zainab Ali at Lambda World 2017


Peeling The Banana: Recursion Schemes From First Principles

Recursion is at the heart of every functional programmer’s toolkit, but with it comes a lot of boilerplate. In the early 1990s, the seminal paper Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire (Erik Meijer, M.M. Fokkinga, and Ross Paterson) introduced a little-known technique known as recursion schemes. This technique makes recursion generic, removing much of the boilerplate associated with it, and cleanly separating business logic from recursive traversal. It paved the way to many different schemes, each for their own kind of recursive traversal.

This talk explores the technique of recursion schemes and how to use it. We start with primitive recursion, briefly diving into folds, before deriving the catamorphism, a specific recursion schema for the right fold. We shall see that there is a rich zoo of recursion schemes for different types of folds, unfolds and more.

Subscribe to the Lambda World YouTube channel to be updated when new videos are added.

Ensure the success of your project

47 Degrees can work with you to help manage the risks of technology evolution, develop a team of top-tier engaged developers, improve productivity, lower maintenance cost, increase hardware utilization, and improve product quality; all while using the best technologies.