[][src]Struct gluon_check::substitution::Substitution

pub struct Substitution<T> where
    T: Substitutable
{ /* fields omitted */ }

Methods

impl<T> Substitution<T> where
    T: Substitutable
[src]

pub fn new(factory: T::Factory, interner: T::Interner) -> Substitution<T>[src]

pub fn var_id(&self) -> u32[src]

pub fn insert(&self, var: u32, t: T)[src]

pub fn replace(&mut self, var: u32, t: T)[src]

pub fn reset(&mut self, var: u32)[src]

pub fn snapshot(&mut self) -> Snapshot[src]

pub fn commit(&mut self, snapshot: Snapshot)[src]

pub fn rollback_to(&mut self, snapshot: Snapshot)[src]

pub fn clear_from(&mut self, level: u32)[src]

Assumes that no variables unified with anything (but variables < level may exist)

pub fn new_var(&self) -> T where
    T: Clone + Display
[src]

Creates a new variable

pub fn new_var_fn<F>(&self, f: F) -> T where
    T: Clone,
    F: FnOnce(u32) -> T, 
[src]

pub fn real<'r>(&'r self, typ: &'r T) -> &'r T[src]

If typ is a variable this returns the real unified value of that variable. Otherwise it just returns the type itself. Note that the returned type may contain terms which also need to have real called on them.

pub fn get_var(&self, var: u32) -> Option<&T>[src]

pub fn find_type_for_var(&self, var: u32) -> Option<&T>[src]

pub fn get_level(&self, var: u32) -> u32[src]

pub fn replace_variable(&self, typ: &T) -> Option<T> where
    T: Clone
[src]

impl<T: Substitutable + Clone> Substitution<T>[src]

pub fn make_real(&self, typ: &mut T)[src]

impl<T: Substitutable + PartialEq + Clone> Substitution<T>[src]

pub fn union(&self, variable: &T, typ: &T) -> Result<(), Error<T>> where
    T::Variable: Clone,
    T: Display
[src]

Takes id and updates the substitution to say that it should have the same type as typ

impl Substitution<RcType>[src]

pub fn new_skolem(&self, name: Symbol, kind: ArcKind) -> RcType[src]

pub fn zonk(&self, typ: &RcType) -> RcType[src]

pub fn bind_arc(&self, typ: &RcType) -> ArcType[src]

Trait Implementations

impl<T> Default for Substitution<T> where
    T: Substitutable,
    T::Factory: Default,
    T::Interner: Default
[src]

impl<T> Debug for Substitution<T> where
    T: Debug + Substitutable
[src]

impl<T> TypeContext<Symbol, T> for Substitution<T> where
    T: Substitutable + From<Type<Symbol, T>>,
    &'a T::Interner: TypeContext<Symbol, T>, 
[src]

impl<'a, T> TypeContext<Symbol, T> for &'a Substitution<T> where
    T: Substitutable + From<Type<Symbol, T>>,
    &'a T::Interner: TypeContext<Symbol, T>, 
[src]

impl<'a> Substitution<Symbol, ArcType<Symbol>> for &'a Substitution<RcType>[src]

Auto Trait Implementations

impl<T> Send for Substitution<T> where
    T: Send,
    <T as Substitutable>::Factory: Send,
    <T as Substitutable>::Interner: Send

impl<T> !Sync for Substitution<T>

impl<T> Unpin for Substitution<T> where
    T: Unpin,
    <T as Substitutable>::Factory: Unpin,
    <T as Substitutable>::Interner: Unpin

impl<T> UnwindSafe for Substitution<T> where
    T: UnwindSafe,
    <T as Substitutable>::Factory: UnwindSafe,
    <T as Substitutable>::Interner: UnwindSafe

impl<T> !RefUnwindSafe for Substitution<T>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]