pub struct ChurchNumerals;Expand description
Church encoding utilities for natural numbers.
Implementations§
Source§impl ChurchNumerals
impl ChurchNumerals
Sourcepub fn church_zero_desc() -> &'static str
pub fn church_zero_desc() -> &'static str
Church numeral zero: Λf.Λx. x (conceptual).
Sourcepub fn church_succ_desc() -> &'static str
pub fn church_succ_desc() -> &'static str
Church numeral succ: Λn.Λf.Λx. f (n f x).
Sourcepub fn church_to_u64(n: u64) -> u64
pub fn church_to_u64(n: u64) -> u64
Convert Church numeral to actual u64 (simulation).
Sourcepub fn church_add(m: u64, n: u64) -> u64
pub fn church_add(m: u64, n: u64) -> u64
Church addition: λm.λn.λf.λx. m f (n f x).
Sourcepub fn church_mul(m: u64, n: u64) -> u64
pub fn church_mul(m: u64, n: u64) -> u64
Church multiplication: λm.λn.λf. m (n f).
Sourcepub fn church_pow(m: u64, n: u64) -> u64
pub fn church_pow(m: u64, n: u64) -> u64
Church exponentiation: λm.λn. n m.
Auto Trait Implementations§
impl Freeze for ChurchNumerals
impl RefUnwindSafe for ChurchNumerals
impl Send for ChurchNumerals
impl Sync for ChurchNumerals
impl Unpin for ChurchNumerals
impl UnsafeUnpin for ChurchNumerals
impl UnwindSafe for ChurchNumerals
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more