use std::{fmt::Debug, str::FromStr};
pub trait NeutralElts: PartialEq {
fn zero() -> Self;
fn one() -> Self;
}
impl<T> NeutralElts for T
where
T: From<u8> + PartialEq,
{
fn zero() -> Self {
T::from(0)
}
fn one() -> Self {
T::from(1)
}
}
pub trait DataType: Clone + FromStr + Debug + Default {}
impl<T: Clone + FromStr + Debug + Default> DataType for T {}
#[cfg(feature = "partial")]
pub trait DiffDataType: DataType + From<f32> + NeutralElts {}
#[cfg(feature = "partial")]
impl<T: DataType + From<f32> + NeutralElts> DiffDataType for T {}