use core::convert::Infallible;
use crate::{
lt::{HktWrapper, LifetimeHkt},
Lt,
};
impl<H: ?Sized> TypeFn for HktWrapper<H>
where
Self: for<'y> LifetimeHkt<Actual<'y>: TypeFn>,
{
type Output<L: Lt> = <L::NextTypeFn<Self> as TypeFn>::Output<L::NextExtending>;
}
pub trait TypeFn: Sized {
type Output<L: Lt>: ?Sized;
}
impl TypeFn for () {
type Output<L: Lt> = Self;
}
impl TypeFn for Infallible {
type Output<L: Lt> = Self;
}
#[macro_export]
macro_rules! TypeFn {
(for <> $T:ty) => { $crate::Value<$T> };
(for <$lt0:lifetime $(,$lt:lifetime)* $(,)?> $T:ty) => {
$crate::LifetimeHkt![for<$lt0> $crate::TypeFn![for <$($lt),*> $T]]
};
($T:ty) => { $crate::Value<$T> };
}