Enum adapton::catalog::collections::List
[−]
[src]
pub enum List<X> { Nil, Cons(X, Box<List<X>>), Tree(Box<Tree<X>>, Dir2, Box<List<X>>), Name(Name, Box<List<X>>), Art(Art<List<X>>), }
Variants
Nil
Cons(X, Box<List<X>>)
Tree(Box<Tree<X>>, Dir2, Box<List<X>>)
Name(Name, Box<List<X>>)
Art(Art<List<X>>)
Trait Implementations
impl<X: Debug> Debug for List<X>
[src]
impl<X: PartialEq> PartialEq for List<X>
[src]
fn eq(&self, __arg_0: &List<X>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &List<X>) -> bool
This method tests for !=
.
impl<X: Eq> Eq for List<X>
[src]
impl<X: Hash> Hash for List<X>
[src]
fn hash<__HX: Hasher>(&self, __arg_0: &mut __HX)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the state provided.
impl<X: Clone> Clone for List<X>
[src]
fn clone(&self) -> List<X>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<X: 'static + Debug + Hash + PartialEq + Eq + Clone> ListIntro<X> for List<X>
[src]
fn nil() -> Self
Introduce an empty list
fn cons(hd: X, tl: Self) -> Self
Introduce a Cons cell
fn name(nm: Name, tl: Self) -> Self
Introduce a Name "cons" cell
fn art(art: Art<List<X>>) -> Self
Introduce a list with an articulation that holds a list
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. Read more
impl<X: 'static + Debug + Hash + PartialEq + Eq + Clone> ListElim<X> for List<X>
[src]
fn elim<Res, NilF, ConsF, NameF>(
list: &Self,
nilf: NilF,
consf: ConsF,
namef: NameF
) -> Res where
NilF: FnOnce(&Self) -> Res,
ConsF: FnOnce(&X, &Self) -> Res,
NameF: FnOnce(&Name, &Self) -> Res,
list: &Self,
nilf: NilF,
consf: ConsF,
namef: NameF
) -> Res where
NilF: FnOnce(&Self) -> Res,
ConsF: FnOnce(&X, &Self) -> Res,
NameF: FnOnce(&Name, &Self) -> Res,
Eliminate a list with the given functions (for the pattern match arms) that handle the nil
, cons
and name
cases. Eliminates the art
case internally, by forcing the art and eliminating the resulting list with the given handler functions; forces multiple art
cases, if need be. Read more
fn elim_arg<Arg, Res, NilF, ConsF, NameF>(
list: Self,
arg: Arg,
nilf: NilF,
consf: ConsF,
namef: NameF
) -> Res where
NilF: FnOnce(Self, Arg) -> Res,
ConsF: FnOnce(X, Self, Arg) -> Res,
NameF: FnOnce(Name, Self, Arg) -> Res,
list: Self,
arg: Arg,
nilf: NilF,
consf: ConsF,
namef: NameF
) -> Res where
NilF: FnOnce(Self, Arg) -> Res,
ConsF: FnOnce(X, Self, Arg) -> Res,
NameF: FnOnce(Name, Self, Arg) -> Res,
Like elim
, except that the functions are given an additional argument. This variant is needed due to the move semantics of Rust. The argument is moved into the body of the activated handler function when it is applied. Read more
fn is_empty(list: &Self) -> bool
Tests if the list contains any cons
cells. Derived from elim
.
fn is_name(list: &Self) -> bool
Tests if the head of the list consists of a name
constructor. Derived from elim
.