cgp-type 0.8.0-alpha

A language extension for Rust, with pluggable trait implementations at compile-time.
Documentation
1
2
3
4
5
6
7
8
9
10
use cgp::macro_prelude::*;
use cgp_macro::cgp_component;

#[cgp_component(TypeProvider)]
#[derive_delegate(UseDelegate<Tag>)]
pub trait HasType<Tag> {
    type Type;
}

pub type TypeOf<Context, Tag> = <Context as HasType<Tag>>::Type;