cgp-field 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
11
12
13
14
15
16
use crate::types::{Cons, Nil};

pub trait AppendProduct<Item: ?Sized> {
    type Output;
}

impl<Item> AppendProduct<Item> for Nil {
    type Output = Cons<Item, Nil>;
}

impl<Head, Tail, Item> AppendProduct<Item> for Cons<Head, Tail>
where
    Tail: AppendProduct<Item>,
{
    type Output = Cons<Head, Tail::Output>;
}