Church integer – Computing Reference – eLook.org


Church integer



A representation of integers as functions invented by Alonzo Church, inventor of lambda-calculus.

The integer N is represented as a higher-order function which applies a given function N times to a given expression.

In the pure lambda-calculus there are no constants but numbers can be represented by Church integers.

A Haskell function to return a given Church integer could be written:

church n = c where c f x = if n == 0 then x else c’ f (f x) where c’ = church (n-1)

A function to turn a Church integer into an ordinary integer:

unchurch c = c (+1) 0

See also von Neumann integer.

< Previous Terms Terms Containing Church integer Next Terms >
chroot
CHRP
chug
chunker
Church, Alonzo
Church integer
lambda-calculus
Church of the SubGenius
Church-Rosser Theorem
ci
CI$
CICERO
Read More
2 weeks ago
37
2 weeks ago
26
2 weeks ago
28

New Casinos
Download the latest version of Dragon Tiger online casino APK for Android! Enjoy safe, free gameplay and unleash your luck in this thrilling card game.
Explore Mascot Gaming's top online casinos and gaming slots! Discover exciting bonuses, thrilling casino games, and the best mascot gaming slots for 2024!
Best online casino games on Banger.casino! Play on mobile apps or desktop and win real money. ✓ Get your welcome bonus +125% UP TO €250 right now!

© Copyright 2024 | Elook.org