Skip to main content
Top

2021 | OriginalPaper | Chapter

11. More Fun with Recursion

Authors : Donald Sannella, Michael Fourman, Haoran Peng, Philip Wadler

Published in: Introduction to Computation

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

We’ll now look at more examples of recursively defined functions which demonstrate some points that didn’t arise in earlier examples. To start, recall the notation [1..10]. Underlying this notation is the following Prelude function, where [m..n ] stands for enumFromTo m n: Here the recursion is on integers rather than lists. We’ve learned how important it is that recursion is well-founded: it’s okay to define the result of applying a function to a value in terms of its application to a smaller value. But here, we’re defining enumFromTo m n in terms of enumFromTo (m+1) n! Of course, m+1 is larger than m; how can that be right? And the first equation must be the base case, since there is no recursion, but it looks different from all of the previous examples, so what’s going on there?.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Metadata
Title
More Fun with Recursion
Authors
Donald Sannella
Michael Fourman
Haoran Peng
Philip Wadler
Copyright Year
2021
DOI
https://doi.org/10.1007/978-3-030-76908-6_11

Premium Partner