ecsilarant 0.1.0

Sketch of an ECS for the future
Documentation
#[derive(Clone, PartialEq, Debug)]
pub(crate) struct Empty;

#[derive(Clone, PartialEq, Debug)]
pub(crate) struct Cons<T, Tail> {
    pub(crate) head: T,
    pub(crate) tail: Tail,
}

impl<T, Tail> Cons<T, Tail> {
    pub(crate) fn new(head: T, tail: Tail) -> Self {
        Cons { head, tail }
    }
}

pub(crate) trait Seq: Sized {
    fn extend<U>(self, value: U) -> Cons<U, Self>;
}

impl Seq for Empty {
    fn extend<U>(self, value: U) -> Cons<U, Self> {
        Cons {
            head: value,
            tail: self,
        }
    }
}

impl<T, Tail: Seq> Seq for Cons<T, Tail> {
    fn extend<U>(self, value: U) -> Cons<U, Self> {
        Cons {
            head: value,
            tail: self,
        }
    }
}