use std::ops::Deref;
use super::coercion::{CoercibleInto, CommonNum, MinimallyNumeric};
pub fn map_common_numeric<I, LItem, RItem, DLItem, DRItem, LNum, RNum, Output>(
    i: I,
) -> impl Iterator<Item = (Output, Output)>
where
    I: IntoIterator<Item = (LItem, RItem)>,
    LItem: MinimallyNumeric<As = LNum> + Deref<Target = DLItem>,
    RItem: MinimallyNumeric<As = RNum> + Deref<Target = DRItem>,
    DLItem: CoercibleInto<LNum> + Clone,
    DRItem: CoercibleInto<RNum> + Clone,
    (LNum, RNum): CommonNum<Common = Output>,
{
    i.into_iter().map(|(l, r)| {
        (
            CoercibleInto::<LNum>::coerce_into(l.clone()),
            CoercibleInto::<RNum>::coerce_into(r.clone()),
        )
            .into_common()
    })
}