[][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 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
[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 update_level(&self, var: u32, other: u32)[src]

Updates the level of other to be the minimum level value of var and other

pub fn set_level(&self, var: u32, level: u32)[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, id: &T::Variable, typ: &T) -> Result<Option<T>, 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]

fn tuple<S, I>(&mut self, symbols: &mut S, elems: I) -> T where
    I: IntoIterator<Item = T>,
    S: IdentEnv<Ident = Id> + ?Sized
[src]

fn tuple_<S, I>(&mut self, symbols: &mut S, elems: I) -> Type<Id, T> where
    I: IntoIterator<Item = T>,
    S: IdentEnv<Ident = Id> + ?Sized
[src]

fn function<I>(&mut self, args: I, ret: T) -> T where
    I: IntoIterator<Item = T>,
    T: Clone,
    <I as IntoIterator>::IntoIter: DoubleEndedIterator,
    <<I as IntoIterator>::IntoIter as Iterator>::Item == T, 
[src]

fn function_implicit<I>(&mut self, args: I, ret: T) -> T where
    I: IntoIterator<Item = T>,
    <I as IntoIterator>::IntoIter: DoubleEndedIterator,
    <<I as IntoIterator>::IntoIter as Iterator>::Item == T, 
[src]

fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T where
    I: IntoIterator<Item = T>,
    <I as IntoIterator>::IntoIter: DoubleEndedIterator,
    <<I as IntoIterator>::IntoIter as Iterator>::Item == 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]

fn tuple<S, I>(&mut self, symbols: &mut S, elems: I) -> T where
    I: IntoIterator<Item = T>,
    S: IdentEnv<Ident = Id> + ?Sized
[src]

fn tuple_<S, I>(&mut self, symbols: &mut S, elems: I) -> Type<Id, T> where
    I: IntoIterator<Item = T>,
    S: IdentEnv<Ident = Id> + ?Sized
[src]

fn function<I>(&mut self, args: I, ret: T) -> T where
    I: IntoIterator<Item = T>,
    T: Clone,
    <I as IntoIterator>::IntoIter: DoubleEndedIterator,
    <<I as IntoIterator>::IntoIter as Iterator>::Item == T, 
[src]

fn function_implicit<I>(&mut self, args: I, ret: T) -> T where
    I: IntoIterator<Item = T>,
    <I as IntoIterator>::IntoIter: DoubleEndedIterator,
    <<I as IntoIterator>::IntoIter as Iterator>::Item == T, 
[src]

fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T where
    I: IntoIterator<Item = T>,
    <I as IntoIterator>::IntoIter: DoubleEndedIterator,
    <<I as IntoIterator>::IntoIter as Iterator>::Item == 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>

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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