#numbers #type #no-alloc

no-std peano-axioms

Type-level numbers based on an extension of the Peano axioms

1 unstable release

0.1.0 Apr 9, 2024

#105 in No standard library

Download history 142/week @ 2024-04-09

142 downloads per month

MIT license

46KB
1.5K SLoC

peano-axioms

peano-axioms is a crate for type-level arithmetic based on an extension of the Peano axioms.

Examples

use peano_axioms::{One, Two, Three, Six, Product};

assert_eq!(Product::<Two, Three>::VALUE, Six::VALUE);
assert_eq!(Difference::<Three, Two>::VALUE, One::VALUE);

// Fails to compile
// assert_eq!(Difference::<Two, Three>::VALUE, One::VALUE);

lib.rs:

Type-level numbers based on an extension of the Peano axioms.

Dependencies

~310–760KB
~18K SLoC