Church encoding: numbers defined as functions

in #programming8 years ago

The Church numeral 3 represents the action of applying any given function three times to a value. The supplied function is first applied to a supplied parameter and then successively to its own result. The end result is not the numeral 3 (unless the supplied parameter happens to be 0 and the function is a successor function). The function itself, and not its end result, is the Church numeral 3. The Church numeral 3 means simply to do anything three times. It is an ostensive demonstration of what is meant by "three times".

Arithmetic operations on numbers may be represented by functions on Church numerals. These functions may be defined in lambda calculus, or implemented in most functional programming languages (see converting lambda expressions to functions).

References

  1. https://en.wikipedia.org/wiki/Church_encoding
  2. https://en.wikipedia.org/wiki/Lambda_lifting#Conversion_without_lifting
  3. http://www.cs.unc.edu/~stotts/723/Lambda/church.html
Sort:  

This post has been ranked within the top 50 most undervalued posts in the second half of Jan 12. We estimate that this post is undervalued by $6.30 as compared to a scenario in which every voter had an equal say.

See the full rankings and details in The Daily Tribune: Jan 12 - Part II. You can also read about some of our methodology, data analysis and technical details in our initial post.

If you are the author and would prefer not to receive these comments, simply reply "Stop" to this comment.

Coin Marketplace

STEEM 0.16
TRX 0.16
JST 0.030
BTC 58418.48
ETH 2515.89
USDT 1.00
SBD 2.36