use crate::generic::{Field, Generic, Sum}; impl Generic for (A, B) { type Representation = Sum, Field>; fn generalize(self) -> Self::Representation { let (l, r) = self; Sum { left: Field { value: l }, right: Field { value: r } } } fn specialize(rep: Self::Representation) -> Self { let Sum { left: Field { value: a }, right: Field { value: b }, } = rep; (a, b) } }