> You can't have Foo<N> * Foo<M> -> Foo<N+M> or similar.
You can though, unless I totally misunderstand your syntax
use std::{marker::PhantomData, ops::{Add, Mul}};
pub struct Foo<T> {
_p: PhantomData<T>,
}
impl<N, M> Mul<Foo<M>> for Foo<N>
where
N: Add<M>
{
type Output = Foo<<N as Add<M>>::Output>;
fn mul(self, rhs: Foo<M>) -> Self::Output {
todo!()
}
}