# Today I Learned

Some of the things I've learned every day since Oct 10, 2016

## 49: Church Numerals

November 28, 2016

Posted by on In Church encoding, an encoding system using lambda calculus, the **Church numerals** are the representation of the natural numbers. The distinguishing feature of the Church numerals is that the natural numbers are not treated as a primitive type, as they would typically be, but are simply represented by higher-order functions. Each higher-order function representing the number takes two arguments — a function and a second argument to be passed to — and returns the -fold composition of .

Examples:

0 is represented as , which given any function returns a function which simply returns without applying at all.

1 is represented as , which given any function returns a function which applies once to .

2 is represented as , which given any function returns a function which applies twice to .

3 is represented as , which given any function returns a function which applies three times to .

Advertisements

## Recent Comments