Church integer
theory
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.
(1994-11-29)
Read Also:
- Church-invisible
noun, Theology. 1. the entire body of Christian believers on earth and in heaven.
- Church-key
noun, Slang. 1. a small metal can opener having a sharp triangular pointed end for punching holes in the top of a beverage can, as of beer. noun 1. (US) a device with a triangular point at one end for making holes in the tops of cans noun phrase A bottle or can opener (1950s+)
- Churchless
[church-lis] /ˈtʃɜrtʃ lɪs/ adjective 1. without a . 2. not belonging to or attending any . 3. without approval or ceremony.
- Churchlike
[church-lahyk] /ˈtʃɜrtʃˌlaɪk/ adjective 1. resembling or appropriate to a : churchlike silence.
- Churchly
[church-lee] /ˈtʃɜrtʃ li/ adjective 1. of or appropriate for the or a ; ecclesiastical: churchly vestments. /ˈtʃɜːtʃlɪ/ adjective 1. appropriate to, associated with, or suggestive of church life and customs