#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

#311 in No standard library

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

~240–690KB
~16K SLoC