Function lambda_calculus::data::pair::curry
source · pub fn curry() -> Term
Expand description
Applied to a function and two arguments a
and b
, it applies the function to the
lambda-encoded pair (a, b)
.
CURRY ≡ λfab.f (PAIR a b) ≡ λ λ λ 3 (PAIR 2 1)
Example
use lambda_calculus::data::pair::{fst, curry};
use lambda_calculus::*;
assert_eq!(
beta(app!(curry(), fst(), 1.into_church(), 2.into_church()), NOR, 0),
1.into_church()
);