type-fn 0.2.0

Allows for simpler coding of type-level logic, e.g. for type-number systems.
Documentation
use type_fn::*;

#[derive(Debug)]
pub struct True;
#[derive(Debug)]
pub struct False;

type_fn! {
    pub fn Or<A, B>;
    pub fn And<A, B>;
    pub fn Xor<A, B>;
    pub fn Not<A>;
}

type_fn_impl! {
    fn Or< => True, B> => True;
    fn Or< => False, B> => B;

    fn And< => True, B> => B;
    fn And< => False, B> => False;

    fn Not< => True> => False;
    fn Not< => False> => True;

    fn Xor< => True, B>
        where Not<B>: + TypeFn,
        => <Not<B> as TypeFn>::Ret;
    fn Xor< => False, B> => B;
}

fn main() {
    println!(
        "True AND False: {}",
        core::any::type_name::<<And<True, False> as TypeFn>::Ret>()
    );
    println!(
        "True OR False: {}",
        core::any::type_name::<<Or<True, False> as TypeFn>::Ret>()
    );
}