Module lambda_calculus::arithmetic [] [src]

Church-encoded numerals and arithmetic operations

Functions

eq

Applied to two Church-encoded numbers it returns a Church-encoded boolean indicating whether its first argument is egual to the second one.

geq

Applied to two Church-encoded numbers it returns a Church-encoded boolean indicating whether its first argument is greater than or egual to the second one.

gt

Applied to two Church-encoded numbers it returns a Church-encoded boolean indicating whether its first argument is greater than the second one.

is_zero

Applied to a Church-encoded number it produces a Church-encoded boolean, indicating whether its argument is equal to zero.

leq

Applied to two Church-encoded numbers it returns a Church-encoded boolean indicating whether its first argument is less than or egual to the second one.

lt

Applied to two Church-encoded numbers it returns a Church-encoded boolean indicating whether its first argument is less than the second one.

mult

Applied to two Church-encoded numbers it produces their product.

neq

Applied to two Church-encoded numbers it returns a Church-encoded boolean indicating whether its first argument is not egual to the second one.

one

Produces a Church-encoded number one.

plus

Applied to two Church-encoded numbers it produces their sum.

pow

Applied to two Church-encoded numbers it raises the first one to the power of the second one.

pred

Applied to a Church-encoded number it produces its predecessor.

sub

Applied to two Church-encoded numbers it subtracts the second one from the first one.

succ

Applied to a Church-encoded number it produces its successor.

zero

Produces a Church-encoded number zero.