use typle::typle; // Tuple with all components of the same specific type #[typle(Tuple for 0..=2)] impl> TupleA {} // Tuple with components that can be different types, but all bound by the // same traits. #[typle(Tuple for 0..=2)] impl TraitB for TupleB where T: Tuple + Debug, T<_>: Extract, T<_>::Output: AsRef, { } // Tuples can have some components bound by using a range. A single component // can be named using a constant. #[typle(Tuple for 1..=2)] impl Extract for TupleC where S: Debug + Tuple, S<{ 1.. }>: Extract, T: Tuple, T<0>: Extract>, T: Debug, { } // typle_bound! allows the component index to be used in the trait bound #[typle(Tuple for 1..=2)] impl TraitD for TupleD> where T: Tuple, typle_bound!(i in .. => T<{i}>): Mul>, T<{ T::LEN - 1 }>: AsRef, F: Fn(T) -> T, { fn g() { // T{ ..T::MAX } expands to all types in a referenced enum let f: TupleD> = TupleD::>::new(); T::<0>::output_to_bytestream(); } }