type-sets 0.2.1

Sets implemented in the rust type-system
Documentation
// use std::marker::PhantomData;

// use super::*;

// #[allow(non_camel_case_types, dead_code)]
// mod _priv {
//     use super::*;

//     pub(super) trait Intersection_1_1<A1, B1>: Subset<(A1,)> + Subset<(B1,)> {}

//     pub(super) trait Intersection2<A1, A2>: Subset<(A1, A2)> + Subset<(A1,)> {}
//     pub(super) trait Intersection2_1<A1, A2, B1>:
//         Intersection2<A1, A2> + Subset<(B1,)>
//     {
//     }
//     pub(super) trait Intersection2_2<A1, A2, B1, B2>:
//         Intersection2<A1, A2> + Intersection_1_1<B1, B2>
//     {
//     }

//     pub(super) trait Intersection3<A1, A2, A3>:
//         Subset<(A1, A2, A3)> + Intersection2<A1, A2>
//     {
//     }
//     pub(super) trait Intersection3_1<A1, A2, A3, B1>:
//         Intersection3<A1, A2, A3> + Subset<(B1,)>
//     {
//     }
//     pub(super) trait Intersection3_2<A1, A2, A3, B1, B2>:
//         Intersection3<A1, A2, A3> + Intersection_1_1<B1, B2>
//     {
//     }
//     pub(super) trait Intersection3_3<A1, A2, A3, B1, B2, B3>:
//         Intersection3<A1, A2, A3> + Intersection3<B1, B2, B3>
//     {
//     }

//     pub(super) trait Intersection4<A1, A2, A3, A4>:
//         Subset<(A1, A2, A3, A4)> + Intersection3<A1, A2, A3>
//     {
//     }
//     pub(super) trait Intersection4_1<A1, A2, A3, A4, B1>:
//         Intersection4<A1, A2, A3, A4> + Subset<(B1,)>
//     {
//     }
//     pub(super) trait Intersection4_2<A1, A2, A3, A4, B1, B2>:
//         Intersection4<A1, A2, A3, A4> + Intersection_1_1<B1, B2>
//     {
//     }
//     pub(super) trait Intersection4_3<A1, A2, A3, A4, B1, B2, B3>:
//         Intersection4<A1, A2, A3, A4> + Intersection3<B1, B2, B3>
//     {
//     }
//     pub(super) trait Intersection4_4<A1, A2, A3, A4, B1, B2, B3, B4>:
//         Intersection4<A1, A2, A3, A4> + Intersection4<B1, B2, B3, B4>
//     {
//     }
// }
// use _priv::*;

// pub trait IntersectionEmpty<R>: Sized
// where
//     Intersection<Self, R>: Subset<()>,
// {
// }

// pub struct Intersection<T, R>(PhantomData<(T, R)>);

// impl<T, R, E> Contains1<E> for Intersection<T, R>
// where
//     T: Contains1<E>,
//     R: Contains1<E>,
// {
// }

// // ------------------ 0 -----------------------
// impl<S> Subset<S> for Intersection<(), ()> {}

// // ------------------ 1 -----------------------
// impl<S, A1> Subset<S> for Intersection<(A1,), ()> where (A1,): Subset<S> {}
// impl<S, B1> Subset<S> for Intersection<(), (B1,)> where (B1,): Subset<S> {}
// impl<S, A1, B1> Subset<S> for Intersection<(A1,), (B1,)> where
//     dyn Intersection_1_1<A1, B1>: Subset<S>
// {
// }

// // ------------------ 2 -----------------------
// impl<S, A1, A2> Subset<S> for Intersection<(A1, A2), ()> where dyn Intersection2<A1, A2>: Subset<S> {}
// impl<S, B1, B2> Subset<S> for Intersection<(), (B1, B2)> where dyn Intersection2<B1, B2>: Subset<S> {}
// impl<S, A1, A2, B1> Subset<S> for Intersection<(A1, A2), (B1,)> where
//     dyn Intersection2_1<A1, A2, B1>: Subset<S>
// {
// }
// impl<S, A1, B1, B2> Subset<S> for Intersection<(A1,), (B1, B2)> where
//     dyn Intersection2_1<B1, B2, A1>: Subset<S>
// {
// }
// impl<S, A1, A2, B1, B2> Subset<S> for Intersection<(A1, A2), (B1, B2)> where
//     dyn Intersection2_2<A1, A2, B1, B2>: Subset<S>
// {
// }

// // ------------------ 3 -----------------------
// impl<S, A1, A2, A3> Subset<S> for Intersection<(A1, A2, A3), ()> where
//     dyn Intersection3<A1, A2, A3>: Subset<S>
// {
// }
// impl<S, B1, B2, B3> Subset<S> for Intersection<(), (B1, B2, B3)> where
//     dyn Intersection3<B1, B2, B3>: Subset<S>
// {
// }
// impl<S, A1, A2, A3, B1> Subset<S> for Intersection<(A1, A2, A3), (B1,)> where
//     dyn Intersection3_1<A1, A2, A3, B1>: Subset<S>
// {
// }
// impl<S, A1, B1, B2, B3> Subset<S> for Intersection<(A1,), (B1, B2, B3)> where
//     dyn Intersection3_1<B1, B2, B3, A1>: Subset<S>
// {
// }
// impl<S, A1, A2, A3, B1, B2> Subset<S> for Intersection<(A1, A2, A3), (B1, B2)> where
//     dyn Intersection3_2<A1, A2, A3, B1, B2>: Subset<S>
// {
// }
// impl<S, A1, A2, B1, B2, B3> Subset<S> for Intersection<(A1, A2), (B1, B2, B3)> where
//     dyn Intersection3_2<B1, B2, B3, A1, A2>: Subset<S>
// {
// }
// impl<S, A1, A2, A3, B1, B2, B3> Subset<S> for Intersection<(A1, A2, A3), (B1, B2, B3)> where
//     dyn Intersection3_3<A1, A2, A3, B1, B2, B3>: Subset<S>
// {
// }

// // ------------------ 4 -----------------------
// impl<S, A1, A2, A3, A4> Subset<S> for Intersection<(A1, A2, A3, A4), ()> where
//     dyn Intersection4<A1, A2, A3, A4>: Subset<S>
// {
// }
// impl<S, B1, B2, B3, B4> Subset<S> for Intersection<(), (B1, B2, B3, B4)> where
//     dyn Intersection4<B1, B2, B3, B4>: Subset<S>
// {
// }
// impl<S, A1, A2, A3, A4, B1> Subset<S> for Intersection<(A1, A2, A3, A4), (B1,)> where
//     dyn Intersection4_1<A1, A2, A3, A4, B1>: Subset<S>
// {
// }
// impl<S, A1, B1, B2, B3, B4> Subset<S> for Intersection<(A1,), (B1, B2, B3, B4)> where
//     dyn Intersection4_1<B1, B2, B3, B4, A1>: Subset<S>
// {
// }
// impl<S, A1, A2, A3, A4, B1, B2> Subset<S> for Intersection<(A1, A2, A3, A4), (B1, B2)> where
//     dyn Intersection4_2<A1, A2, A3, A4, B1, B2>: Subset<S>
// {
// }
// impl<S, A1, A2, B1, B2, B3, B4> Subset<S> for Intersection<(A1, A2), (B1, B2, B3, B4)> where
//     dyn Intersection4_2<B1, B2, B3, B4, A1, A2>: Subset<S>
// {
// }
// impl<S, A1, A2, A3, A4, B1, B2, B3> Subset<S> for Intersection<(A1, A2, A3, A4), (B1, B2, B3)> where
//     dyn Intersection4_3<A1, A2, A3, A4, B1, B2, B3>: Subset<S>
// {
// }
// impl<S, A1, A2, A3, B1, B2, B3, B4> Subset<S> for Intersection<(A1, A2, A3), (B1, B2, B3, B4)> where
//     dyn Intersection4_3<B1, B2, B3, B4, A1, A2, A3>: Subset<S>
// {
// }
// impl<S, A1, A2, A3, A4, B1, B2, B3, B4> Subset<S>
//     for Intersection<(A1, A2, A3, A4), (B1, B2, B3, B4)>
// where
//     dyn Intersection4_4<A1, A2, A3, A4, B1, B2, B3, B4>: Subset<S>,
// {
// }