Trait gluon_base::types::TypeContext
source · pub trait TypeContext<Id, T>where
T: TypePtr<Id = Id>,{
Show 47 methods
// Required methods
fn intern_flags(&mut self, typ: Type<Id, T>, flags: Flags) -> T;
fn intern(&mut self, typ: Type<Id, T>) -> T;
fn intern_types(&mut self, types: impl IntoIterator<Item = T>) -> T::Types;
fn intern_generics(
&mut self,
types: impl IntoIterator<Item = Generic<Id>>
) -> T::Generics;
fn intern_fields(
&mut self,
types: impl IntoIterator<Item = Field<T::SpannedId, T>>
) -> T::Fields;
fn intern_type_fields(
&mut self,
types: impl IntoIterator<Item = Field<T::SpannedId, Alias<Id, T>>>
) -> T::TypeFields;
// Provided methods
fn hole(&mut self) -> T { ... }
fn opaque(&mut self) -> T { ... }
fn error(&mut self) -> T { ... }
fn builtin(&mut self, typ: BuiltinType) -> T { ... }
fn forall(&mut self, params: T::Generics, typ: T) -> T { ... }
fn with_forall(&mut self, typ: T, from: &T) -> T
where Id: Clone + Eq + Hash,
T: TypeExt<Id = Id> + Clone,
T::Generics: FromIterator<Generic<Id>> + Clone { ... }
fn array(&mut self, typ: T) -> T { ... }
fn array_builtin(&mut self) -> T { ... }
fn app(&mut self, id: T, args: T::Types) -> T { ... }
fn variant(&mut self, fields: T::Fields) -> T { ... }
fn poly_variant(&mut self, fields: T::Fields, rest: T) -> T { ... }
fn effect(&mut self, fields: T::Fields) -> T { ... }
fn poly_effect(&mut self, fields: T::Fields, rest: T) -> T { ... }
fn tuple<S, I>(&mut self, symbols: &mut S, elems: I) -> T
where S: ?Sized + IdentEnv<Ident = Id>,
T::SpannedId: From<(Id, Span<BytePos>)>,
I: IntoIterator<Item = T>,
T: HasSpan { ... }
fn tuple_<S, I>(&mut self, symbols: &mut S, elems: I) -> Type<Id, T>
where S: ?Sized + IdentEnv<Ident = Id>,
T::SpannedId: From<(Id, Span<BytePos>)>,
T: HasSpan,
I: IntoIterator<Item = T> { ... }
fn record(&mut self, types: T::TypeFields, fields: T::Fields) -> T { ... }
fn poly_record(
&mut self,
types: T::TypeFields,
fields: T::Fields,
rest: T
) -> T { ... }
fn extend_full_row(
&mut self,
types: T::TypeFields,
fields: T::Fields,
rest: T
) -> T { ... }
fn extend_row(&mut self, fields: T::Fields, rest: T) -> T { ... }
fn extend_type_row(&mut self, types: T::TypeFields, rest: T) -> T { ... }
fn empty_row(&mut self) -> T { ... }
fn function<I>(&mut self, args: I, ret: T) -> T
where I: IntoIterator<Item = T>,
I::IntoIter: DoubleEndedIterator<Item = T> { ... }
fn function_implicit<I>(&mut self, args: I, ret: T) -> T
where I: IntoIterator<Item = T>,
I::IntoIter: DoubleEndedIterator<Item = T> { ... }
fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T
where I: IntoIterator<Item = T>,
I::IntoIter: DoubleEndedIterator<Item = T> { ... }
fn generic(&mut self, typ: Generic<Id>) -> T { ... }
fn skolem(&mut self, typ: Skolem<Id>) -> T { ... }
fn variable(&mut self, typ: TypeVariable) -> T { ... }
fn alias(&mut self, name: Id, args: T::Generics, typ: T) -> T { ... }
fn ident(&mut self, id: KindedIdent<Id>) -> T { ... }
fn projection(&mut self, id: AppVec<Id>) -> 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 builtin_type(&mut self, typ: BuiltinType) -> T { ... }
fn new_alias(&mut self, name: Id, args: T::Generics, typ: T) -> Alias<Id, T> { ... }
fn new_data_alias(&mut self, data: AliasData<Id, T>) -> Alias<Id, T> { ... }
fn alias_group(&mut self, group: Vec<AliasData<Id, T>>) -> Vec<Alias<Id, T>>
where T: TypeExt<Id = Id>,
Id: PartialEq { ... }
}
Required Methods§
fn intern_flags(&mut self, typ: Type<Id, T>, flags: Flags) -> T
fn intern(&mut self, typ: Type<Id, T>) -> T
fn intern_types(&mut self, types: impl IntoIterator<Item = T>) -> T::Types
fn intern_generics( &mut self, types: impl IntoIterator<Item = Generic<Id>> ) -> T::Generics
fn intern_fields( &mut self, types: impl IntoIterator<Item = Field<T::SpannedId, T>> ) -> T::Fields
fn intern_type_fields( &mut self, types: impl IntoIterator<Item = Field<T::SpannedId, Alias<Id, T>>> ) -> T::TypeFields
Provided Methods§
fn hole(&mut self) -> T
fn opaque(&mut self) -> T
fn error(&mut self) -> T
fn builtin(&mut self, typ: BuiltinType) -> T
fn forall(&mut self, params: T::Generics, typ: T) -> T
fn with_forall(&mut self, typ: T, from: &T) -> T
fn array(&mut self, typ: T) -> T
fn array_builtin(&mut self) -> T
fn app(&mut self, id: T, args: T::Types) -> T
fn variant(&mut self, fields: T::Fields) -> T
fn poly_variant(&mut self, fields: T::Fields, rest: T) -> T
fn effect(&mut self, fields: T::Fields) -> T
fn poly_effect(&mut self, fields: T::Fields, rest: T) -> T
fn tuple<S, I>(&mut self, symbols: &mut S, elems: I) -> T
fn tuple_<S, I>(&mut self, symbols: &mut S, elems: I) -> Type<Id, T>
fn record(&mut self, types: T::TypeFields, fields: T::Fields) -> T
fn poly_record(&mut self, types: T::TypeFields, fields: T::Fields, rest: T) -> T
fn extend_full_row( &mut self, types: T::TypeFields, fields: T::Fields, rest: T ) -> T
fn extend_row(&mut self, fields: T::Fields, rest: T) -> T
fn extend_type_row(&mut self, types: T::TypeFields, rest: T) -> T
fn empty_row(&mut self) -> T
fn function<I>(&mut self, args: I, ret: T) -> T
fn function_implicit<I>(&mut self, args: I, ret: T) -> T
fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T
fn generic(&mut self, typ: Generic<Id>) -> T
fn skolem(&mut self, typ: Skolem<Id>) -> T
fn variable(&mut self, typ: TypeVariable) -> T
fn alias(&mut self, name: Id, args: T::Generics, typ: T) -> T
fn ident(&mut self, id: KindedIdent<Id>) -> T
fn projection(&mut self, id: AppVec<Id>) -> 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 builtin_type(&mut self, typ: BuiltinType) -> T
fn new_alias(&mut self, name: Id, args: T::Generics, typ: T) -> Alias<Id, T>
fn new_data_alias(&mut self, data: AliasData<Id, T>) -> Alias<Id, T>
fn alias_group(&mut self, group: Vec<AliasData<Id, T>>) -> Vec<Alias<Id, T>>
Object Safety§
This trait is not object safe.