pub struct Context { /* private fields */ }Expand description
A struct which keeps track of the context leading up to some expression, e.g. its depth, what variables are accessible, and whether the context has a constant function.
Implementations§
Source§impl Context
impl Context
Sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Does the context have any constant functions preceding it?
Sourcepub fn current_variable_types(&self) -> impl Iterator<Item = &LambdaType>
pub fn current_variable_types(&self) -> impl Iterator<Item = &LambdaType>
What are the current possible variable types
Sourcepub fn applications<'a, 'b: 'a>(
&'a self,
lambda_type: &'b LambdaType,
) -> impl Iterator<Item = (LambdaType, LambdaType)> + 'a
pub fn applications<'a, 'b: 'a>( &'a self, lambda_type: &'b LambdaType, ) -> impl Iterator<Item = (LambdaType, LambdaType)> + 'a
What possible applications can be created at this point?
Sourcepub fn variables<'src, T: LambdaLanguageOfThought>(
&self,
lambda_type: &LambdaType,
) -> impl Iterator<Item = LambdaExpr<'src, T>>
pub fn variables<'src, T: LambdaLanguageOfThought>( &self, lambda_type: &LambdaType, ) -> impl Iterator<Item = LambdaExpr<'src, T>>
What are the current variables?
Trait Implementations§
Source§impl Ord for Context
impl Ord for Context
Source§impl PartialOrd for Context
impl PartialOrd for Context
impl Eq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef].