[][src]Trait gluon_base::types::TypeExt

pub trait TypeExt: Deref<Target = Type<Self::Id, Self>> + Clone + Sized {
    type Id;
    fn new(typ: Type<Self::Id, Self>) -> Self;
fn strong_count(typ: &Self) -> usize; fn type_field_iter(&self) -> TypeFieldIterator<Self> { ... }
fn row_iter(&self) -> RowIterator<Self> { ... }
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
, { ... }
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: Commented + HasSpan
, { ... }
fn display<A>(&self, width: usize) -> TypeFormatter<Self::Id, Self, A> { ... }
fn apply_args(
        &self,
        params: &[Generic<Self::Id>],
        args: &[Self],
        interner: &mut impl TypeContext<Self::Id, Self>
    ) -> Option<Self>
    where
        Self::Id: Clone + Eq + Hash
, { ... }
fn flags(&self) -> Flags { ... }
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
, { ... }
fn skolemize(
        &self,
        interner: &mut impl Substitution<Self::Id, Self>,
        named_variables: &mut FnvMap<Self::Id, Self>
    ) -> Self
    where
        Self::Id: Clone + Eq + Hash
, { ... }
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
, { ... } }

Associated Types

type Id

Loading content...

Required methods

fn new(typ: Type<Self::Id, Self>) -> Self

fn strong_count(typ: &Self) -> usize

Loading content...

Provided methods

Important traits for TypeFieldIterator<'a, T>
fn type_field_iter(&self) -> TypeFieldIterator<Self>

Returns an iterator over all type fields in a record. { Test, Test2, x, y } => [Test, Test2]

Important traits for RowIterator<'a, T>
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

Important traits for ForallScopeIter<'a, T>
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: Commented + HasSpan

fn display<A>(&self, width: usize) -> TypeFormatter<Self::Id, Self, A>

fn apply_args(
    &self,
    params: &[Generic<Self::Id>],
    args: &[Self],
    interner: &mut impl TypeContext<Self::Id, Self>
) -> Option<Self> where
    Self::Id: Clone + Eq + Hash

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 flags(&self) -> Flags

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

fn skolemize(
    &self,
    interner: &mut impl Substitution<Self::Id, Self>,
    named_variables: &mut FnvMap<Self::Id, Self>
) -> Self where
    Self::Id: Clone + Eq + Hash

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

Loading content...

Implementors

impl<Id> TypeExt for ArcType<Id>[src]

type Id = Id

Important traits for TypeFieldIterator<'a, T>
fn type_field_iter(&self) -> TypeFieldIterator<Self>[src]

Important traits for RowIterator<'a, T>
fn row_iter(&self) -> RowIterator<Self>[src]

fn remove_implicit_args<'a>(&'a self) -> &'a Self[src]

fn remove_forall<'a>(&'a self) -> &'a Self[src]

fn remove_forall_and_implicit_args<'a>(&'a self) -> &'a Self[src]

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
[src]

Important traits for ForallScopeIter<'a, T>
fn forall_scope_iter(&self) -> ForallScopeIter<Self>[src]

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: Commented + HasSpan
[src]

fn display<A>(&self, width: usize) -> TypeFormatter<Self::Id, Self, A>[src]

fn apply_args(
    &self,
    params: &[Generic<Self::Id>],
    args: &[Self],
    interner: &mut impl TypeContext<Self::Id, Self>
) -> Option<Self> where
    Self::Id: Clone + Eq + Hash
[src]

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
[src]

fn skolemize(
    &self,
    interner: &mut impl Substitution<Self::Id, Self>,
    named_variables: &mut FnvMap<Self::Id, Self>
) -> Self where
    Self::Id: Clone + Eq + Hash
[src]

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
[src]

Loading content...