// by Hirrolot
use std::marker::PhantomData;
struct S<X, Y>(PhantomData<X>, PhantomData<Y>);
struct K<X>(PhantomData<X>);
struct Var<X>(PhantomData<X>);
struct Appl<M, N>(PhantomData<M>, PhantomData<N>);
trait Reduce {
type Result;
}
impl<X, Y, Z> Reduce for Appl<S<X, Y>, Z> where {
type Result = Appl<Appl<X, Y>, Appl<Z, Y>>;
}
impl<X, Y> Reduce for Appl<K<X>, Y> {
type Result = X;
}
impl<N, X> Reduce for Appl<Var<X>, N> {
type Result = Self;
}
struct MyVar0;
struct MyVar1;
struct MyVar2;
fn main() {
let _0: <Appl<Var<MyVar0>, Appl<K<MyVar1>, MyVar2>> as Reduce>::Result = todo!();
// let () = _0;
}
Comments
0 B
|👍
/👎
0 B
|👍
/👎