[−][src]Trait gluon_base::types::TypeExt
Required methods
fn strong_count(typ: &Self) -> usize
Provided methods
fn type_field_iter(&self) -> TypeFieldIterator<Self>
Returns an iterator over all type fields in a record.
{ Test, Test2, x, y } => [Test, Test2]
fn arg_iter(&self) -> ArgIterator<Self>
fn implicit_arg_iter(&self) -> ImplicitArgIterator<Self>
fn row_iter(&self) -> RowIterator<Self>
Returns an iterator over all fields in a record.
{ Test, Test2, x, y } => [x, y]
fn remove_implicit_args<'a>(&'a self) -> &'a Self
fn remove_forall<'a>(&'a self) -> &'a Self
fn remove_forall_and_implicit_args<'a>(&'a self) -> &'a Self
fn replace_generics(
&self,
interner: &mut impl TypeContext<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Option<Self> where
Self::Id: Clone + Eq + Hash,
Self: Clone,
Self::Types: Clone,
Self::Generics: Clone,
Self::Fields: Clone,
&self,
interner: &mut impl TypeContext<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Option<Self> where
Self::Id: Clone + Eq + Hash,
Self: Clone,
Self::Types: Clone,
Self::Generics: Clone,
Self::Fields: Clone,
fn replace_generics_(
&self,
interner: &mut impl TypeContext<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Option<Self> where
Self::Id: Clone + Eq + Hash,
Self: Clone,
Self::Types: Clone,
Self::Generics: Clone,
Self::Fields: Clone,
&self,
interner: &mut impl TypeContext<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Option<Self> where
Self::Id: Clone + Eq + Hash,
Self: Clone,
Self::Types: Clone,
Self::Generics: Clone,
Self::Fields: Clone,
fn forall_scope_iter(&self) -> ForallScopeIter<Self>
fn pretty<'a, A>(
&'a self,
arena: &'a Arena<'a, A>
) -> DocBuilder<'a, Arena<'a, A>, A> where
Self::Id: AsRef<str> + 'a,
A: Clone,
Self: HasMetadata + HasSpan,
&'a self,
arena: &'a Arena<'a, A>
) -> DocBuilder<'a, Arena<'a, A>, A> where
Self::Id: AsRef<str> + 'a,
A: Clone,
Self: HasMetadata + HasSpan,
fn display<A>(&self, width: usize) -> TypeFormatter<Self::Id, Self, A> where
Self::Id: AsRef<str>,
Self::Id: AsRef<str>,
fn apply_args<'a>(
&self,
params: &[Generic<Self::Id>],
args: &'a [Self],
interner: &mut impl TypeContext<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Option<Self> where
Self::Id: Clone + Eq + Hash,
Self: Display,
Self::Id: Display,
Self::Types: Clone + FromIterator<Self>,
Self::Generics: Clone,
Self::Fields: Clone,
&self,
params: &[Generic<Self::Id>],
args: &'a [Self],
interner: &mut impl TypeContext<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Option<Self> where
Self::Id: Clone + Eq + Hash,
Self: Display,
Self::Id: Display,
Self::Types: Clone + FromIterator<Self>,
Self::Generics: Clone,
Self::Fields: Clone,
Applies a list of arguments to a parameterised type, returning Some
if the substitution was successful.
Example:
self = forall e t . | Err e | Ok t
args = [Error, Option a]
result = | Err Error | Ok (Option a)
fn arg_application<'a>(
&self,
params: &[Generic<Self::Id>],
args: &'a [Self],
interner: &mut impl TypeContext<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Option<(Self, &'a [Self])> where
Self::Id: Clone + Eq + Hash,
Self: Display,
Self::Id: Display,
Self::Types: FromIterator<Self>,
Self::Generics: Clone,
Self::Fields: Clone,
&self,
params: &[Generic<Self::Id>],
args: &'a [Self],
interner: &mut impl TypeContext<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Option<(Self, &'a [Self])> where
Self::Id: Clone + Eq + Hash,
Self: Display,
Self::Id: Display,
Self::Types: FromIterator<Self>,
Self::Generics: Clone,
Self::Fields: Clone,
fn instantiate_generics(
&self,
interner: &mut impl Substitution<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Self where
Self::Id: Clone + Eq + Hash,
Self::Types: Clone,
Self::Generics: Clone,
Self::Fields: Clone,
&self,
interner: &mut impl Substitution<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Self where
Self::Id: Clone + Eq + Hash,
Self::Types: Clone,
Self::Generics: Clone,
Self::Fields: Clone,
fn skolemize(
&self,
interner: &mut impl Substitution<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Self where
Self::Id: Clone + Eq + Hash,
Self::Types: Clone,
Self::Generics: Clone,
Self::Fields: Clone,
&self,
interner: &mut impl Substitution<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>
) -> Self where
Self::Id: Clone + Eq + Hash,
Self::Types: Clone,
Self::Generics: Clone,
Self::Fields: Clone,
fn skolemize_in(
&self,
interner: &mut impl Substitution<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>,
f: impl FnOnce(Self) -> Self
) -> Self where
Self::Id: Clone + Eq + Hash,
Self::Types: Clone,
Self::Generics: FromIterator<Generic<Self::Id>> + Clone,
Self::Fields: Clone,
&self,
interner: &mut impl Substitution<Self::Id, Self>,
named_variables: &mut FnvMap<Self::Id, Self>,
f: impl FnOnce(Self) -> Self
) -> Self where
Self::Id: Clone + Eq + Hash,
Self::Types: Clone,
Self::Generics: FromIterator<Generic<Self::Id>> + Clone,
Self::Fields: Clone,