Open RustyYato opened 4 years ago
Copying from my /r/rust comment:
The Peano numerals are just to test out the internal consistency of the system. The only barrier to using typenum would be the trait vs. type alias convention. The compiler assumes that any function call
F(X, Y)
can compile intoF<X, Y>
along with the boundX: ComputeF<Y>
. So either you could write a Tyrade-friendly wrapper API for typenum, or add a typenum extension to the compiler.
Someone just needs to do that part, and we can integrate it.
Currently this crate uses
peano
arithmetic, but this is too inefficient in many cases (especially as numbers grow in size). It would be better to usetypenum
which offers all arithmetic operations inO(log(n))
time as the default. (I think we still need to keep the peano arithmetic because there are cases where it is more efficient, for example when counting things).https://github.com/paholg/typenum