[−][src]Struct gluon_check::substitution::Substitution
Methods
impl<T> Substitution<T> where
T: Substitutable,
[src]
T: Substitutable,
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]
T: Clone + Display,
Creates a new variable
pub fn new_var_fn<F>(&self, f: F) -> T where
T: Clone,
F: FnOnce(u32) -> T,
[src]
T: Clone,
F: FnOnce(u32) -> T,
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]
T: Clone,
impl<T: Substitutable + Clone> Substitution<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]
T::Variable: Clone,
T: Display,
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]
T: Substitutable,
T::Factory: Default,
T::Interner: Default,
fn default() -> Substitution<T>
[src]
impl<T> Debug for Substitution<T> where
T: Debug + Substitutable,
[src]
T: Debug + Substitutable,
impl<T> TypeContext<Symbol, T> for Substitution<T> where
T: Substitutable + From<Type<Symbol, T>>,
&'a T::Interner: TypeContext<Symbol, T>,
[src]
T: Substitutable + From<Type<Symbol, T>>,
&'a T::Interner: TypeContext<Symbol, T>,
fn intern(&mut self, typ: Type<Symbol, T>) -> T
fn intern_flags(&mut self, typ: Type<Symbol, T>, flags: Flags) -> T
fn builtin(&mut self, typ: BuiltinType) -> T
fn forall(&mut self, params: Vec<Generic<Symbol>>, typ: T) -> T
fn with_forall(&mut self, typ: T, from: &T) -> T where
Symbol: Clone + Eq + Hash,
T: TypeExt<Id = Symbol> + Clone,
Symbol: Clone + Eq + Hash,
T: TypeExt<Id = Symbol> + Clone,
fn array(&mut self, typ: T) -> T
fn app(&mut self, id: T, args: AppVec<T>) -> T
fn variant(&mut self, fields: Vec<Field<Symbol, T>>) -> T
fn poly_variant(&mut self, fields: Vec<Field<Symbol, T>>, rest: T) -> T
fn effect(&mut self, fields: Vec<Field<Symbol, T>>) -> T
fn poly_effect(&mut self, fields: Vec<Field<Symbol, T>>, rest: T) -> T
fn record(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>
) -> T
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>
) -> T
fn poly_record(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>,
rest: T
) -> T
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>,
rest: T
) -> T
fn extend_full_row(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>,
rest: T
) -> T
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>,
rest: T
) -> T
fn extend_row(&mut self, fields: Vec<Field<Symbol, T>>, rest: T) -> T
fn extend_type_row(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
rest: T
) -> T
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
rest: T
) -> T
fn generic(&mut self, typ: Generic<Symbol>) -> T
fn skolem(&mut self, typ: Skolem<Symbol>) -> T
fn variable(&mut self, typ: TypeVariable) -> T
fn alias(&mut self, name: Symbol, args: Vec<Generic<Symbol>>, typ: T) -> T
fn ident(&mut self, id: Symbol) -> T
fn projection(&mut self, id: AppVec<Symbol>) -> T
fn builtin_type(&mut self, typ: BuiltinType) -> T
fn new_alias(
&mut self,
name: Symbol,
args: Vec<Generic<Symbol>>,
typ: T
) -> Alias<Symbol, T>
&mut self,
name: Symbol,
args: Vec<Generic<Symbol>>,
typ: T
) -> Alias<Symbol, T>
fn new_data_alias(&mut self, data: AliasData<Symbol, T>) -> Alias<Symbol, T>
fn alias_group(
&mut self,
group: Vec<AliasData<Symbol, T>>
) -> Vec<Alias<Symbol, T>> where
T: TypeExt<Id = Symbol>,
Symbol: PartialEq,
&mut self,
group: Vec<AliasData<Symbol, T>>
) -> Vec<Alias<Symbol, T>> where
T: TypeExt<Id = Symbol>,
Symbol: PartialEq,
fn hole(&mut self) -> T
fn opaque(&mut self) -> T
fn error(&mut self) -> T
fn array_builtin(&mut self) -> T
fn empty_row(&mut self) -> T
fn function_builtin(&mut self) -> T
fn string(&mut self) -> T
fn char(&mut self) -> T
fn byte(&mut self) -> T
fn int(&mut self) -> T
fn float(&mut self) -> T
fn unit(&mut self) -> T
fn tuple<S, I>(&mut self, symbols: &mut S, elems: I) -> T where
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
[src]
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
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]
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
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]
I: IntoIterator<Item = T>,
T: Clone,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
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]
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
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]
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
impl<'a, T> TypeContext<Symbol, T> for &'a Substitution<T> where
T: Substitutable + From<Type<Symbol, T>>,
&'a T::Interner: TypeContext<Symbol, T>,
[src]
T: Substitutable + From<Type<Symbol, T>>,
&'a T::Interner: TypeContext<Symbol, T>,
fn intern(&mut self, typ: Type<Symbol, T>) -> T
fn intern_flags(&mut self, typ: Type<Symbol, T>, flags: Flags) -> T
fn builtin(&mut self, typ: BuiltinType) -> T
fn forall(&mut self, params: Vec<Generic<Symbol>>, typ: T) -> T
fn with_forall(&mut self, typ: T, from: &T) -> T where
Symbol: Clone + Eq + Hash,
T: TypeExt<Id = Symbol> + Clone,
Symbol: Clone + Eq + Hash,
T: TypeExt<Id = Symbol> + Clone,
fn array(&mut self, typ: T) -> T
fn app(&mut self, id: T, args: AppVec<T>) -> T
fn variant(&mut self, fields: Vec<Field<Symbol, T>>) -> T
fn poly_variant(&mut self, fields: Vec<Field<Symbol, T>>, rest: T) -> T
fn effect(&mut self, fields: Vec<Field<Symbol, T>>) -> T
fn poly_effect(&mut self, fields: Vec<Field<Symbol, T>>, rest: T) -> T
fn record(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>
) -> T
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>
) -> T
fn poly_record(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>,
rest: T
) -> T
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>,
rest: T
) -> T
fn extend_full_row(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>,
rest: T
) -> T
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
fields: Vec<Field<Symbol, T>>,
rest: T
) -> T
fn extend_row(&mut self, fields: Vec<Field<Symbol, T>>, rest: T) -> T
fn extend_type_row(
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
rest: T
) -> T
&mut self,
types: Vec<Field<Symbol, Alias<Symbol, T>>>,
rest: T
) -> T
fn generic(&mut self, typ: Generic<Symbol>) -> T
fn skolem(&mut self, typ: Skolem<Symbol>) -> T
fn variable(&mut self, typ: TypeVariable) -> T
fn alias(&mut self, name: Symbol, args: Vec<Generic<Symbol>>, typ: T) -> T
fn ident(&mut self, id: Symbol) -> T
fn projection(&mut self, id: AppVec<Symbol>) -> T
fn builtin_type(&mut self, typ: BuiltinType) -> T
fn new_alias(
&mut self,
name: Symbol,
args: Vec<Generic<Symbol>>,
typ: T
) -> Alias<Symbol, T>
&mut self,
name: Symbol,
args: Vec<Generic<Symbol>>,
typ: T
) -> Alias<Symbol, T>
fn new_data_alias(&mut self, data: AliasData<Symbol, T>) -> Alias<Symbol, T>
fn alias_group(
&mut self,
group: Vec<AliasData<Symbol, T>>
) -> Vec<Alias<Symbol, T>> where
T: TypeExt<Id = Symbol>,
Symbol: PartialEq,
&mut self,
group: Vec<AliasData<Symbol, T>>
) -> Vec<Alias<Symbol, T>> where
T: TypeExt<Id = Symbol>,
Symbol: PartialEq,
fn hole(&mut self) -> T
fn opaque(&mut self) -> T
fn error(&mut self) -> T
fn array_builtin(&mut self) -> T
fn empty_row(&mut self) -> T
fn function_builtin(&mut self) -> T
fn string(&mut self) -> T
fn char(&mut self) -> T
fn byte(&mut self) -> T
fn int(&mut self) -> T
fn float(&mut self) -> T
fn unit(&mut self) -> T
fn tuple<S, I>(&mut self, symbols: &mut S, elems: I) -> T where
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
[src]
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
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]
I: IntoIterator<Item = T>,
S: IdentEnv<Ident = Id> + ?Sized,
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]
I: IntoIterator<Item = T>,
T: Clone,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
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]
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
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]
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: DoubleEndedIterator,
<<I as IntoIterator>::IntoIter as Iterator>::Item == T,
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,
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,
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,
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,