Hostname: page-component-76fb5796d-dfsvx Total loading time: 0 Render date: 2024-04-26T21:41:05.578Z Has data issue: false hasContentIssue false

THEORETICAL PEARL Church numerals, twice!

Published online by Cambridge University Press:  08 December 2004

RALF HINZE
Affiliation:
Institut für Informatik III, Universität Bonn, Römerstraβe 164, 53117 Bonn, Germany (e-mail: ralf@informatik.uni-bonn.de)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

This pearl explains Church numerals, twice. The first explanation links Church numerals to Peano numerals via the well-known encoding of data types in the polymorphic λ-calculus. This view suggests that Church numerals are folds in disguise. The second explanation, which is more elaborate, but also more insightful, derives Church numerals from first principles, that is, from an algebraic specification of addition and multiplication. Additionally, we illustrate the use of the parametricity theorem by proving exponentiation as reverse application correct.

Type
Theoretical pearls
Copyright
© 2004 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.