use core::ops::{Not, Neg};
use super::basic::{B0, B1, Z0, P1, N1, NonZero};
impl Neg for Z0 { type Output = Z0;
fn neg(self) -> Self::Output {
Z0
}
}
impl Neg for N1 { type Output = P1;
fn neg(self) -> Self::Output {
P1
}
}
impl Neg for P1 {
type Output = N1;
fn neg(self) -> Self::Output {
N1
}
}
impl<H: NonZero + Neg> Neg for B0<H>{
type Output = B0<H::Output>;
fn neg(self) -> Self::Output {
B0::new()
}
}
impl<H: NonZero + Not> Neg for B1<H>{
type Output = B0<H::Output>;
fn neg(self) -> Self::Output {
B0::new()
}
}
pub type Negate<A> = <A as Neg>::Output;