Note, all this is happening compile time. True, False being types is intended. It is not a mistake.
Suppose we have:
pub struct True {};
pub struct False {};
is it possible to design a "IsEqual" so that "A IsEqual A => True", "A IsEqual B => False" for A != B
One possible approach is:
pub trait IsEqualT<Target> {
type BoolOutput;
}
(A as IsEqualT<B>)::BoolOutput
This technique can be made to work, but all the structs, 'A', and 'B' must be declared via a procedural macro which injects a Uid field containing a typenum number: lhlist/lib.rs at master · agnes-rs/lhlist · GitHub
=====
Question: is there a simpler way to do this?