Trait adapton::catalog::collections::ListIntro
[−]
[src]
pub trait ListIntro<X: 'static>: Debug + Clone + Hash + PartialEq + Eq + 'static { fn nil() -> Self; fn cons(_: X, _: Self) -> Self; fn name(_: Name, _: Self) -> Self; fn art(_: Art<Self>) -> Self; fn singleton(hd: X) -> Self { ... } fn name_art(nm: Option<Name>, rest: Self) -> Self { ... } }
Types that can be created like a list of X
are ListIntro<X>
Required Methods
fn nil() -> Self
Introduce an empty list
fn cons(_: X, _: Self) -> Self
Introduce a Cons cell
fn name(_: Name, _: Self) -> Self
Introduce a Name "cons" cell
fn art(_: Art<Self>) -> Self
Introduce a list with an articulation that holds a list
Provided Methods
fn singleton(hd: X) -> Self
Creates a singleton list. Derived from cons
and nil
introduction forms.
fn name_art(nm: Option<Name>, rest: Self) -> Self
For Some(nm)
, wraps the given list in name
and art
constructors for given name nm
.
For None
, is the list identity function.