#![feature(optin_builtin_traits, on_unimplemented, never_type, specialization)]
#![cfg_attr(not(feature = "std"), no_std)]
extern crate either;
pub use into_cons::NotTuple;
use into_cons::{ConsOf, IntoCons};
use tuple::{IntoTuple, TupleOf};
#[macro_use]
pub mod cons;
pub mod into_cons;
pub mod tuple;
pub trait Flatten: Sized + IntoCons {
type Flattened;
fn flatten(self) -> Self::Flattened;
}
impl<Tup> Flatten for Tup
where
ConsOf<Self>: IntoTuple<Self>,
{
type Flattened = TupleOf<ConsOf<Self>, Self>;
#[inline(always)]
fn flatten(self) -> Self::Flattened {
self.into_cons().into_tuple()
}
}
pub type Flattened<T> = <T as Flatten>::Flattened;