1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pub enum List<L: ListFn> {
    Some(L::Item, L),
    End(L::End),
}

/// A function which returns a list.
pub trait ListFn: Sized {
    type Item;
    type End;
    fn list(self) -> List<Self>;
}